home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Source / WinTlb / COMMCTRL.IDL < prev    next >
Text File  |  1997-05-28  |  137KB  |  4,040 lines

  1. // Common Control types, constants, and functions
  2.  
  3. // Enums
  4.  
  5. typedef enum EILC {
  6.     ILC_MASK             = 0x0001,
  7.     ILC_COLOR            = 0x0000,
  8.     ILC_COLORDDB         = 0x00FE,
  9.     ILC_COLOR4           = 0x0004,
  10.     ILC_COLOR8           = 0x0008,
  11.     ILC_COLOR16          = 0x0010,
  12.     ILC_COLOR24          = 0x0018,
  13.     ILC_COLOR32          = 0x0020,
  14.     ILC_PALETTE          = 0x0800
  15. } EILC;
  16.  
  17. typedef enum EILD {
  18.     ILD_NORMAL           = 0x0000,
  19.     ILD_TRANSPARENT      = 0x0001,
  20.     ILD_MASK             = 0x0010,
  21.     ILD_IMAGE            = 0x0020,
  22.     ILD_BLEND25          = 0x0002,
  23.     ILD_BLEND50          = 0x0004,
  24.     ILD_OVERLAYMASK      = 0x0F00,
  25.  
  26.     // #define INDEXTOOVERLAYMASK(i)    ((i) << 8)
  27.  
  28.     ILD_SELECTED         = 0x0004,
  29.     ILD_FOCUS            = 0x0004,
  30.     ILD_BLEND            = 0x0F00
  31. } EILD;
  32.  
  33. // Types
  34. typedef struct IMAGEINFO {
  35.     HBITMAP hbmImage;
  36.     HBITMAP hbmMask;
  37.     int     Unused1;
  38.     int     Unused2;
  39.     RECT    rcImage;
  40. } IMAGEINFO;
  41.  
  42. typedef struct _IMAGELISTDRAWPARAMS {
  43.     DWORD       cbSize;
  44.     HIMAGELIST  himl;
  45.     int         i;
  46.     HDC         hdcDst;
  47.     int         x;
  48.     int         y;
  49.     int         cx;
  50.     int         cy;
  51.     int         xBitmap;        // x offest from the upperleft of bitmap
  52.     int         yBitmap;        // y offset from the upperleft of bitmap
  53.     COLORREF    rgbBk;
  54.     COLORREF    rgbFg;
  55.     UINT        fStyle;
  56.     DWORD       dwRop;
  57. } IMAGELISTDRAWPARAMS,  * LPIMAGELISTDRAWPARAMS;
  58.  
  59.  
  60. [
  61. #ifdef UNICODE
  62. uuid(64675056-3A82-101B-8181-00AA003743D3),
  63. #else
  64. uuid(64674056-3A82-101B-8181-00AA003743D3),
  65. #endif
  66. helpstring("Common Controls"),
  67. dllname("COMCTL32")
  68. ]
  69. module CommonControl {
  70.  
  71.     //====== Ranges for control message IDs =========
  72.     #define LVM_FIRST               0x1000      // ListView messages
  73.     #define TV_FIRST                0x1100      // TreeView messages
  74.     #define HDM_FIRST               0x1200      // Header messages
  75.  
  76.     #if 0
  77.  
  78.  
  79.     //==================== CUSTOM DRAW ==========================================
  80.  
  81.     // custom draw return flags
  82.     // values under 0x00010000 are reserved for global custom draw values.
  83.     // above that are for specific controls
  84.     #define CDRF_DODEFAULT          0x00000000
  85.     #define CDRF_NEWFONT            0x00000002
  86.     #define CDRF_SKIPDEFAULT        0x00000004
  87.  
  88.  
  89.     #define CDRF_NOTIFYPOSTPAINT    0x00000010
  90.     #define CDRF_NOTIFYITEMDRAW     0x00000020
  91.     #define CDRF_NOTIFYPOSTERASE    0x00000040
  92.     #define CDRF_NOTIFYITEMERASE    0x00000080
  93.  
  94.  
  95.  
  96.     // drawstage flags
  97.     // values under 0x00010000 are reserved for global custom draw values.
  98.     // above that are for specific controls
  99.     #define CDDS_PREPAINT           0x00000001
  100.     #define CDDS_POSTPAINT          0x00000002
  101.     #define CDDS_PREERASE           0x00000003
  102.     #define CDDS_POSTERASE          0x00000004
  103.     // the 0x000010000 bit means it's individual item specific
  104.     #define CDDS_ITEM               0x00010000
  105.     #define CDDS_ITEMPREPAINT       (CDDS_ITEM | CDDS_PREPAINT)
  106.     #define CDDS_ITEMPOSTPAINT      (CDDS_ITEM | CDDS_POSTPAINT)
  107.     #define CDDS_ITEMPREERASE       (CDDS_ITEM | CDDS_PREERASE)
  108.     #define CDDS_ITEMPOSTERASE      (CDDS_ITEM | CDDS_POSTERASE)
  109.  
  110.  
  111.  
  112.     // itemState flags
  113.     #define CDIS_SELECTED    0x0001
  114.     #define CDIS_GRAYED      0x0002
  115.     #define CDIS_DISABLED    0x0004
  116.     #define CDIS_CHECKED     0x0008
  117.     #define CDIS_FOCUS       0x0010
  118.     #define CDIS_DEFAULT     0x0020
  119.     #define CDIS_HOT         0x0040
  120.  
  121.     typedef struct tagNMCUSTOMDRAWINFO
  122.     {
  123.         NMHDR hdr;
  124.         DWORD dwDrawStage;
  125.         HDC hdc;
  126.         RECT rc;
  127.         DWORD dwItemSpec;  // this is control specific, but it's how to specify an item.  valid only with CDDS_ITEM bit set
  128.         UINT  uItemState;
  129.         LPARAM lItemlParam;
  130.     } NMCUSTOMDRAW, * LPNMCUSTOMDRAW;
  131.  
  132.  
  133.  
  134.     // for tooltips
  135.  
  136.     typedef struct tagNMTTCUSTOMDRAW
  137.     {
  138.         NMCUSTOMDRAW nmcd;
  139.         UINT uDrawFlags;
  140.     } NMTTCUSTOMDRAW, * LPNMTTCUSTOMDRAW;
  141.  
  142.     #endif
  143.  
  144.     //====== IMAGE APIS ========
  145.  
  146.     const DWORD CLR_NONE            = 0xFFFFFFFF;
  147.     const DWORD CLR_DEFAULT         = 0xFF000000;
  148.  
  149.     [
  150.     usesgetlasterror,
  151.     entry("ImageList_Create"),
  152.     helpstring("Creates a new image list"),
  153.     ]
  154.     HIMAGELIST WINAPI ImageList_Create(int cx, int cy,
  155.                                        UINT flags,
  156.                                        int cInitial,
  157.                                        int cGrow);
  158.  
  159.     [
  160.     usesgetlasterror,
  161.     entry("ImageList_Destroy"),
  162.     helpstring("Destroys an image list"),
  163.     ]
  164.     BOOL WINAPI ImageList_Destroy(HIMAGELIST himl);
  165.  
  166.     [
  167.     usesgetlasterror,
  168.     entry("ImageList_GetImageCount"),
  169.     helpstring("Gets the number of images in an image list"),
  170.     ]
  171.     int WINAPI ImageList_GetImageCount(HIMAGELIST himl);
  172.  
  173.     [
  174.     usesgetlasterror,
  175.     entry("ImageList_Add"),
  176.     helpstring("Adds an image or images to an image list"),
  177.     ]
  178.     int WINAPI ImageList_Add(HIMAGELIST himl,
  179.                              HBITMAP hbmImage,
  180.                              HBITMAP hbmMask);
  181.  
  182.     [
  183.     usesgetlasterror,
  184.     entry("ImageList_ReplaceIcon"),
  185.     helpstring("Replaces an image with an icon or cursor"),
  186.     ]
  187.     int WINAPI ImageList_ReplaceIcon(HIMAGELIST himl,
  188.                                      int i,
  189.                                      HICON hicon);
  190.  
  191.     [
  192.     usesgetlasterror,
  193.     entry("ImageList_SetBkColor"),
  194.     helpstring("Sets the image list background color"),
  195.     ]
  196.     COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl,
  197.                                          COLORREF clrBk);
  198.  
  199.     [
  200.     usesgetlasterror,
  201.     entry("ImageList_GetBkColor"),
  202.     helpstring("Gets the image list background color"),
  203.     ]
  204.     COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST himl);
  205.  
  206.     [
  207.     usesgetlasterror,
  208.     entry("ImageList_SetOverlayImage"),
  209.     helpstring("Adds the index of an image to the list of images to be used as overlay masks"),
  210.     ]
  211.     BOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST himl,
  212.                                           int iImage,
  213.                                           int iOverlay);
  214.  
  215.     // #define ImageList_AddIcon(himl, hicon) \
  216.     //         ImageList_ReplaceIcon(himl, -1, hicon)
  217.  
  218.     const DWORD CLR_HILIGHT         = 0xFF000000; // -16777216;
  219.  
  220.     [
  221.     usesgetlasterror,
  222.     entry("ImageList_Draw"),
  223.     helpstring("Draws an image list item in the specified device context"),
  224.     ]
  225.     BOOL WINAPI ImageList_Draw(HIMAGELIST himl,
  226.                                int i, HDC hdcDst,
  227.                                int x, int y,
  228.                                UINT fStyle);
  229.  
  230.     [
  231.     usesgetlasterror,
  232.     entry("ImageList_Replace"),
  233.     helpstring("Replaces an image in an image list with a new image"),
  234.     ]
  235.     BOOL WINAPI ImageList_Replace(HIMAGELIST himl,
  236.                                   int i,
  237.                                   HBITMAP hbmImage,
  238.                                   HBITMAP hbmMask);
  239.  
  240.     [
  241.     usesgetlasterror,
  242.     entry("ImageList_AddMasked"),
  243.     helpstring("Adds an image or images to an image list, generating a mask from the specified bitmap"),
  244.     ]
  245.     int WINAPI ImageList_AddMasked(HIMAGELIST himl,
  246.                                    HBITMAP hbmImage,
  247.                                    COLORREF crMask);
  248.  
  249.     [
  250.     usesgetlasterror,
  251.     entry("ImageList_DrawEx"),
  252.     helpstring("Draws an image list item in the specified device context using the given drawing style and color"),
  253.     ]
  254.     BOOL WINAPI ImageList_DrawEx(HIMAGELIST himl,
  255.                                  int i, HDC hdcDst,
  256.                                  int x, int y,
  257.                                  int dx, int dy,
  258.                                  COLORREF rgbBk,
  259.                                  COLORREF rgbFg,
  260.                                  UINT fStyle);
  261.  
  262.     [
  263.     usesgetlasterror,
  264.     entry("ImageList_Remove"),
  265.     helpstring("Removes an image from an image list"),
  266.     ]
  267.     BOOL WINAPI ImageList_Remove(HIMAGELIST himl, int i);
  268.  
  269.     [
  270.     usesgetlasterror,
  271.     entry("ImageList_GetIcon"),
  272.     helpstring("Creates an icon or cursor based on an image and mask in an image list"),
  273.     ]
  274.     HICON WINAPI ImageList_GetIcon(HIMAGELIST himl,
  275.                                    int i, UINT flags);
  276.  
  277.     [
  278.     usesgetlasterror,
  279.     #ifdef UNICODE
  280.     entry("ImageList_LoadImageW"),
  281.     #else
  282.     entry("ImageList_LoadImageA"),
  283.     #endif
  284.     helpstring("Creates an image list from the specified bitmap, cursor, or icon resource"),
  285.     ]
  286.     HIMAGELIST WINAPI ImageList_LoadImage(HINSTANCE hi,
  287.                                           LPCTSTR lpbmp,
  288.                                           int cx, int cGrow,
  289.                                           COLORREF crMask,
  290.                                           UINT uType, UINT uFlags);
  291.  
  292.     [
  293.     usesgetlasterror,
  294.     entry("ImageList_BeginDrag"),
  295.     helpstring("Begins dragging an image"),
  296.     ]
  297.     BOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack,
  298.                                     int iTrack,
  299.                                     int dxHotspot,
  300.                                     int dyHotspot);
  301.  
  302.     [
  303.     usesgetlasterror,
  304.     entry("ImageList_EndDrag"),
  305.     helpstring("Ends a drag operation"),
  306.     ]
  307.     void WINAPI ImageList_EndDrag();
  308.  
  309.     [
  310.     usesgetlasterror,
  311.     entry("ImageList_DragEnter"),
  312.     helpstring("Updates the specified window during a drag operation and displays the drag image at the specified position"),
  313.     ]
  314.     BOOL WINAPI ImageList_DragEnter(HWND hwndLock,
  315.                                     int x, int y);
  316.  
  317.     [
  318.     usesgetlasterror,
  319.     entry("ImageList_DragLeave"),
  320.     helpstring("Unlocks the specified window and hides the drag image, allowing the window to be updated"),
  321.     ]
  322.     BOOL WINAPI ImageList_DragLeave(HWND hwndLock);
  323.  
  324.     [
  325.     usesgetlasterror,
  326.     entry("ImageList_DragMove"),
  327.     helpstring("Moves the image that is being dragged during a drag-and-drop operation"),
  328.     ]
  329.     BOOL WINAPI ImageList_DragMove(int x, int y);
  330.  
  331.     [
  332.     usesgetlasterror,
  333.     entry("ImageList_SetDragCursorImage"),
  334.     helpstring("Creates a new drag image by combining the specified image (typically a cursor) with the current drag image"),
  335.     ]
  336.     BOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag,
  337.                                              int iDrag,
  338.                                              int dxHotspot,
  339.                                              int dyHotspot);
  340.  
  341.     [
  342.     usesgetlasterror,
  343.     entry("ImageList_DragShowNolock"),
  344.     helpstring("Shows or hides the image being dragged"),
  345.     ]
  346.     BOOL        WINAPI ImageList_DragShowNolock(BOOL fShow);
  347.  
  348.     [
  349.     usesgetlasterror,
  350.     entry("ImageList_GetDragImage"),
  351.     helpstring("Retrieves temporary drag image list, position, and offset"),
  352.     ]
  353.     HIMAGELIST  WINAPI ImageList_GetDragImage(int * ppt,
  354.                                               int * pptHotspot);
  355.  
  356.     // #define  ImageList_RemoveAll(himl)
  357.     //          ImageList_Remove(himl, -1)
  358.     // #define  ImageList_ExtractIcon(hi, himl, i)
  359.     //          ImageList_GetIcon(himl, i, 0)
  360.     // #define  ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask)
  361.     //          ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0)
  362.  
  363.     #ifdef __IStream_INTERFACE_DEFINED__
  364.  
  365.     [
  366.     usesgetlasterror,
  367.     entry("ImageList_Read"),
  368.     helpstring("Reads an image list from a stream"),
  369.     ]
  370.     HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm);
  371.  
  372.     [
  373.     usesgetlasterror,
  374.     entry("ImageList_Write"),
  375.     helpstring("Writes an image list to a stream"),
  376.     ]
  377.     BOOL WINAPI ImageList_Write(HIMAGELIST himl,
  378.                                 LPSTREAM pstm);
  379.  
  380.     #endif
  381.  
  382.     [
  383.     usesgetlasterror,
  384.     entry("ImageList_GetIconSize"),
  385.     helpstring("Gets the dimensions of images in an image list"),
  386.     ]
  387.     BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl,
  388.                                       int * cx,
  389.                                       int *cy);
  390.  
  391.     [
  392.     usesgetlasterror,
  393.     entry("ImageList_SetIconSize"),
  394.     helpstring("Sets the dimensions of images in an image list"),
  395.     ]
  396.     BOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl,
  397.                                       int cx, int cy);
  398.  
  399.     [
  400.     usesgetlasterror,
  401.     entry("ImageList_GetImageInfo"),
  402.     helpstring("Gets information about an image"),
  403.     ]
  404.     BOOL WINAPI ImageList_GetImageInfo(HIMAGELIST himl,
  405.                                        int i,
  406.                                        IMAGEINFO * pImageInfo);
  407.  
  408.     [
  409.     usesgetlasterror,
  410.     entry("ImageList_Merge"),
  411.     helpstring("Creates a new image by combining two existing images, and stores it in a new image list"),
  412.     ]
  413.     HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1, int i1,
  414.                                       HIMAGELIST himl2, int i2,
  415.                                       int dx, int dy);
  416.  
  417.     //====== HEADER CONTROL ========
  418.  
  419.     #define NOHEADER
  420.     #ifndef NOHEADER
  421.  
  422.     #define HDS_HORZ                0x0000
  423.     #define HDS_BUTTONS             0x0002
  424.     #define HDS_HOTTRACK            0x0004
  425.     #define HDS_HIDDEN              0x0008
  426.  
  427.  
  428.     #define HDS_DRAGDROP            0x0040
  429.     #define HDS_FULLDRAG            0x0080
  430.  
  431.     typedef struct _HD_ITEMA
  432.     {
  433.         UINT    mask;
  434.         int     cxy;
  435.         LPSTR   pszText;
  436.         HBITMAP hbm;
  437.         int     cchTextMax;
  438.         int     fmt;
  439.         LPARAM  lParam;
  440.         int     iImage;        // index of bitmap in ImageList
  441.         int     iOrder;        // where to draw this item
  442.     } HDITEMA, * LPHDITEMA;
  443.  
  444.  
  445.  
  446.     typedef struct _HD_ITEMW
  447.     {
  448.         UINT    mask;
  449.         int     cxy;
  450.         LPWSTR   pszText;
  451.         HBITMAP hbm;
  452.         int     cchTextMax;
  453.         int     fmt;
  454.         LPARAM  lParam;
  455.         int     iImage;        // index of bitmap in ImageList
  456.         int     iOrder;
  457.     } HDITEMW, * LPHDITEMW;
  458.  
  459.     #define HD_ITEMA HDITEMA
  460.     #define HD_ITEMW HDITEMW
  461.  
  462.     #ifdef UNICODE
  463.     #define HDITEM HDITEMW
  464.     #define LPHDITEM LPHDITEMW
  465.     #else
  466.     #define HDITEM HDITEMA
  467.     #define LPHDITEM LPHDITEMW
  468.     #endif
  469.  
  470.     #define HD_ITEM HDITEM
  471.  
  472.  
  473.     #define HDI_WIDTH               0x0001
  474.     #define HDI_HEIGHT              HDI_WIDTH
  475.     #define HDI_TEXT                0x0002
  476.     #define HDI_FORMAT              0x0004
  477.     #define HDI_LPARAM              0x0008
  478.     #define HDI_BITMAP              0x0010
  479.     #define HDI_IMAGE               0x0020
  480.     #define HDI_DI_SETITEM          0x0040
  481.     #define HDI_ORDER               0x0080
  482.  
  483.     #define HDF_LEFT                0
  484.     #define HDF_RIGHT               1
  485.     #define HDF_CENTER              2
  486.     #define HDF_JUSTIFYMASK         0x0003
  487.     #define HDF_RTLREADING          4
  488.  
  489.     #define HDF_OWNERDRAW           0x8000
  490.     #define HDF_STRING              0x4000
  491.     #define HDF_BITMAP              0x2000
  492.     #define HDF_BITMAP_ON_RIGHT 0x1000
  493.  
  494.     #define HDF_IMAGE               0x0800
  495.  
  496.     #define HDM_GETITEMCOUNT        (HDM_FIRST + 0)
  497.     #define Header_GetItemCount(hwndHD) \
  498.         (int)SNDMSG((hwndHD), HDM_GETITEMCOUNT, 0, 0L)
  499.  
  500.  
  501.     #define HDM_INSERTITEMA         (HDM_FIRST + 1)
  502.     #define HDM_INSERTITEMW         (HDM_FIRST + 10)
  503.  
  504.     #ifdef UNICODE
  505.     #define HDM_INSERTITEM          HDM_INSERTITEMW
  506.     #else
  507.     #define HDM_INSERTITEM          HDM_INSERTITEMA
  508.     #endif
  509.  
  510.     #define Header_InsertItem(hwndHD, i, phdi) \
  511.         (int)SNDMSG((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  512.  
  513.  
  514.     #define HDM_DELETEITEM          (HDM_FIRST + 2)
  515.     #define Header_DeleteItem(hwndHD, i) \
  516.         (BOOL)SNDMSG((hwndHD), HDM_DELETEITEM, (WPARAM)(int)(i), 0L)
  517.  
  518.  
  519.     #define HDM_GETITEMA            (HDM_FIRST + 3)
  520.     #define HDM_GETITEMW            (HDM_FIRST + 11)
  521.  
  522.     #ifdef UNICODE
  523.     #define HDM_GETITEM             HDM_GETITEMW
  524.     #else
  525.     #define HDM_GETITEM             HDM_GETITEMA
  526.     #endif
  527.  
  528.     #define Header_GetItem(hwndHD, i, phdi) \
  529.         (BOOL)SNDMSG((hwndHD), HDM_GETITEM, (WPARAM)(int)(i), (LPARAM)(HD_ITEM FAR*)(phdi))
  530.  
  531.  
  532.     #define HDM_SETITEMA            (HDM_FIRST + 4)
  533.     #define HDM_SETITEMW            (HDM_FIRST + 12)
  534.  
  535.     #ifdef UNICODE
  536.     #define HDM_SETITEM             HDM_SETITEMW
  537.     #else
  538.     #define HDM_SETITEM             HDM_SETITEMA
  539.     #endif
  540.  
  541.     #define Header_SetItem(hwndHD, i, phdi) \
  542.         (BOOL)SNDMSG((hwndHD), HDM_SETITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi))
  543.  
  544.  
  545.     typedef struct _HD_LAYOUT
  546.     {
  547.         RECT FAR* prc;
  548.         WINDOWPOS FAR* pwpos;
  549.     } HDLAYOUT, *LPHDLAYOUT;
  550.  
  551.     #define HD_LAYOUT               HDLAYOUT
  552.  
  553.     #define HDM_LAYOUT              (HDM_FIRST + 5)
  554.     #define Header_Layout(hwndHD, playout) \
  555.         (BOOL)SNDMSG((hwndHD), HDM_LAYOUT, 0, (LPARAM)(HD_LAYOUT FAR*)(playout))
  556.  
  557.  
  558.     #define HHT_NOWHERE             0x0001
  559.     #define HHT_ONHEADER            0x0002
  560.     #define HHT_ONDIVIDER           0x0004
  561.     #define HHT_ONDIVOPEN           0x0008
  562.     #define HHT_ABOVE               0x0100
  563.     #define HHT_BELOW               0x0200
  564.     #define HHT_TORIGHT             0x0400
  565.     #define HHT_TOLEFT              0x0800
  566.  
  567.     typedef struct _HD_HITTESTINFO
  568.     {
  569.         POINT pt;
  570.         UINT flags;
  571.         int iItem;
  572.     } HDHITTESTINFO, *LPHDHITTESTINFO;
  573.  
  574.     #define HD_HITTESTINFO HDHITTESTINFO
  575.  
  576.  
  577.     #define HDM_HITTEST             (HDM_FIRST + 6)
  578.  
  579.     #define HDM_GETITEMRECT         (HDM_FIRST + 7)
  580.     #define Header_GetItemRect(hwnd, iItem, lprc) \
  581.             (BOOL)SNDMSG((hwnd), HDM_GETITEMRECT, (WPARAM)iItem, (LPARAM)lprc)
  582.  
  583.     #define HDM_SETIMAGELIST        (HDM_FIRST + 8)
  584.     #define Header_SetImageList(hwnd, himl) \
  585.             (HIMAGELIST)SNDMSG((hwnd), HDM_SETIMAGELIST, 0, (LPARAM)himl)
  586.  
  587.     #define HDM_GETIMAGELIST        (HDM_FIRST + 9)
  588.     #define Header_GetImageList(hwnd) \
  589.             (HIMAGELIST)SNDMSG((hwnd), HDM_GETIMAGELIST, 0, 0)
  590.  
  591.  
  592.     #define HDM_ORDERTOINDEX        (HDM_FIRST + 15)
  593.     #define Header_OrderToIndex(hwnd, i) \
  594.             (int)SNDMSG((hwnd), HDM_ORDERTOINDEX, (WPARAM)i, 0)
  595.  
  596.     #define HDM_CREATEDRAGIMAGE     (HDM_FIRST + 16)  // wparam = which item (by index)
  597.     #define Header_CreateDragImage(hwnd, i) \
  598.             (HIMAGELIST)SNDMSG((hwnd), HDM_CREATEDRAGIMAGE, (WPARAM)i, 0)
  599.  
  600.     #define HDM_GETORDERARRAY       (HDM_FIRST + 17)
  601.     #define Header_GetOrderArray(hwnd, iCount, lpi) \
  602.             (BOOL)SNDMSG((hwnd), HDM_GETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
  603.  
  604.     #define HDM_SETORDERARRAY       (HDM_FIRST + 18)
  605.     #define Header_SetOrderArray(hwnd, iCount, lpi) \
  606.             (BOOL)SNDMSG((hwnd), HDM_SETORDERARRAY, (WPARAM)iCount, (LPARAM)lpi)
  607.     // lparam = int array of size HDM_GETITEMCOUNT
  608.     // the array specifies the order that all items should be displayed.
  609.     // e.g.  { 2, 0, 1}
  610.     // says the index 2 item should be shown in the 0ths position
  611.     //      index 0 should be shown in the 1st position
  612.     //      index 1 should be shown in the 2nd position
  613.  
  614.  
  615.     #define HDM_SETHOTDIVIDER          (HDM_FIRST + 19)
  616.     #define Header_SetHotDivider(hwnd, fPos, dw) \
  617.             (int)SNDMSG((hwnd), HDM_SETHOTDIVIDER, (WPARAM)fPos, (LPARAM)dw)
  618.     // convenience message for external dragdrop
  619.     // wParam = BOOL  specifying whether the lParam is a dwPos of the cursor
  620.     //              position or the index of which divider to hotlight
  621.     // lParam = depends on wParam  (-1 and wParm = FALSE turns off hotlight)
  622.  
  623.     #define HDN_ITEMCHANGINGA       (HDN_FIRST-0)
  624.     #define HDN_ITEMCHANGINGW       (HDN_FIRST-20)
  625.     #define HDN_ITEMCHANGEDA        (HDN_FIRST-1)
  626.     #define HDN_ITEMCHANGEDW        (HDN_FIRST-21)
  627.     #define HDN_ITEMCLICKA          (HDN_FIRST-2)
  628.     #define HDN_ITEMCLICKW          (HDN_FIRST-22)
  629.     #define HDN_ITEMDBLCLICKA       (HDN_FIRST-3)
  630.     #define HDN_ITEMDBLCLICKW       (HDN_FIRST-23)
  631.     #define HDN_DIVIDERDBLCLICKA    (HDN_FIRST-5)
  632.     #define HDN_DIVIDERDBLCLICKW    (HDN_FIRST-25)
  633.     #define HDN_BEGINTRACKA         (HDN_FIRST-6)
  634.     #define HDN_BEGINTRACKW         (HDN_FIRST-26)
  635.     #define HDN_ENDTRACKA           (HDN_FIRST-7)
  636.     #define HDN_ENDTRACKW           (HDN_FIRST-27)
  637.     #define HDN_TRACKA              (HDN_FIRST-8)
  638.     #define HDN_TRACKW              (HDN_FIRST-28)
  639.     #define HDN_GETDISPINFOA        (HDN_FIRST-9)
  640.     #define HDN_GETDISPINFOW        (HDN_FIRST-29)
  641.     #define HDN_BEGINDRAG           (HDN_FIRST-10)
  642.     #define HDN_ENDDRAG             (HDN_FIRST-11)
  643.  
  644.     #ifdef UNICODE
  645.     #define HDN_ITEMCHANGING         HDN_ITEMCHANGINGW
  646.     #define HDN_ITEMCHANGED          HDN_ITEMCHANGEDW
  647.     #define HDN_ITEMCLICK            HDN_ITEMCLICKW
  648.     #define HDN_ITEMDBLCLICK         HDN_ITEMDBLCLICKW
  649.     #define HDN_DIVIDERDBLCLICK      HDN_DIVIDERDBLCLICKW
  650.     #define HDN_BEGINTRACK           HDN_BEGINTRACKW
  651.     #define HDN_ENDTRACK             HDN_ENDTRACKW
  652.     #define HDN_TRACK                HDN_TRACKW
  653.     #define HDN_GETDISPINFO          HDN_GETDISPINFOW
  654.     #else
  655.     #define HDN_ITEMCHANGING         HDN_ITEMCHANGINGA
  656.     #define HDN_ITEMCHANGED          HDN_ITEMCHANGEDA
  657.     #define HDN_ITEMCLICK            HDN_ITEMCLICKA
  658.     #define HDN_ITEMDBLCLICK         HDN_ITEMDBLCLICKA
  659.     #define HDN_DIVIDERDBLCLICK      HDN_DIVIDERDBLCLICKA
  660.     #define HDN_BEGINTRACK           HDN_BEGINTRACKA
  661.     #define HDN_ENDTRACK             HDN_ENDTRACKA
  662.     #define HDN_TRACK                HDN_TRACKA
  663.     #define HDN_GETDISPINFO          HDN_GETDISPINFOA
  664.     #endif
  665.  
  666.  
  667.     typedef struct tagNMHEADERA
  668.     {
  669.         NMHDR   hdr;
  670.         int     iItem;
  671.         int     iButton;
  672.         HDITEMA FAR* pitem;
  673.     }  NMHEADERA, FAR* LPNMHEADERA;
  674.  
  675.  
  676.     typedef struct tagNMHEADERW
  677.     {
  678.         NMHDR   hdr;
  679.         int     iItem;
  680.         int     iButton;
  681.         HDITEMW FAR* pitem;
  682.     } NMHEADERW, FAR* LPNMHEADERW;
  683.  
  684.  
  685.     #ifdef UNICODE
  686.     #define NMHEADER                NMHEADERW
  687.     #define LPNMHEADER              LPNMHEADERW
  688.     #else
  689.     #define NMHEADER                NMHEADERA
  690.     #define LPNMHEADER              LPNMHEADERA
  691.     #endif
  692.  
  693.  
  694.     #define HD_NOTIFYA              NMHEADERA
  695.     #define HD_NOTIFYW              NMHEADERW
  696.     #define HD_NOTIFY               NMHEADER
  697.  
  698.  
  699.     typedef struct tagNMHDDISPINFOW
  700.     {
  701.         NMHDR   hdr;
  702.         int     iItem;
  703.         UINT    mask;
  704.         LPWSTR  pszText;
  705.         int     cchTextMax;
  706.         int     iImage;
  707.         LPARAM  lParam;
  708.     } NMHDDISPINFOW, FAR* LPNMHDDISPINFOW;
  709.  
  710.     typedef struct tagNMHDDISPINFOA
  711.     {
  712.         NMHDR   hdr;
  713.         int     iItem;
  714.         UINT    mask;
  715.         LPSTR   pszText;
  716.         int     cchTextMax;
  717.         int     iImage;
  718.         LPARAM  lParam;
  719.     } NMHDDISPINFOA, FAR* LPNMHDDISPINFOA;
  720.  
  721.  
  722.     #ifdef UNICODE
  723.     #define NMHDDISPINFO            NMHDDISPINFOW
  724.     #define LPNMHDDISPINFO          LPNMHDDISPINFOW
  725.     #else
  726.     #define NMHDDISPINFO            NMHDDISPINFOA
  727.     #define LPNMHDDISPINFO          LPNMHDDISPINFOA
  728.     #endif
  729.  
  730.     #endif
  731.  
  732.     //====== TOOLBAR CONTROL =======
  733.  
  734.     #define NOTOOLBAR
  735.     #ifndef NOTOOLBAR
  736.  
  737.     typedef struct _TBBUTTON {
  738.         int iBitmap;
  739.         int idCommand;
  740.         BYTE fsState;
  741.         BYTE fsStyle;
  742.     #ifdef _WIN32
  743.         BYTE bReserved[2];
  744.     #endif
  745.         DWORD dwData;
  746.         int iString;
  747.     } TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON;
  748.     typedef const TBBUTTON FAR* LPCTBBUTTON;
  749.  
  750.  
  751.     typedef struct _COLORMAP {
  752.         COLORREF from;
  753.         COLORREF to;
  754.     } COLORMAP, FAR* LPCOLORMAP;
  755.  
  756.     WINCOMMCTRLAPI HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD ws, UINT wID, int nBitmaps,
  757.                             HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons,
  758.                             int iNumButtons, int dxButton, int dyButton,
  759.                             int dxBitmap, int dyBitmap, UINT uStructSize);
  760.  
  761.     WINCOMMCTRLAPI HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, int idBitmap,
  762.                                       UINT wFlags, LPCOLORMAP lpColorMap,
  763.                                       int iNumMaps);
  764.  
  765.     #define CMB_MASKED              0x02
  766.  
  767.     #define TBSTATE_CHECKED         0x01
  768.     #define TBSTATE_PRESSED         0x02
  769.     #define TBSTATE_ENABLED         0x04
  770.     #define TBSTATE_HIDDEN          0x08
  771.     #define TBSTATE_INDETERMINATE   0x10
  772.     #define TBSTATE_WRAP            0x20
  773.     #define TBSTATE_ELLIPSES        0x40
  774.  
  775.  
  776.     #define TBSTYLE_BUTTON          0x00
  777.     #define TBSTYLE_SEP             0x01
  778.     #define TBSTYLE_CHECK           0x02
  779.     #define TBSTYLE_GROUP           0x04
  780.     #define TBSTYLE_CHECKGROUP      (TBSTYLE_GROUP | TBSTYLE_CHECK)
  781.     #define TBSTYLE_DROPDOWN        0x08
  782.  
  783.     #define TBSTYLE_TOOLTIPS        0x0100
  784.     #define TBSTYLE_WRAPABLE        0x0200
  785.     #define TBSTYLE_ALTDRAG         0x0400
  786.     #define TBSTYLE_FLAT            0x0800
  787.     #define TBSTYLE_LIST            0x1000
  788.     #define TBSTYLE_CUSTOMERASE     0x2000
  789.  
  790.     #define TB_ENABLEBUTTON         (WM_USER + 1)
  791.     #define TB_CHECKBUTTON          (WM_USER + 2)
  792.     #define TB_PRESSBUTTON          (WM_USER + 3)
  793.     #define TB_HIDEBUTTON           (WM_USER + 4)
  794.     #define TB_INDETERMINATE        (WM_USER + 5)
  795.     #define TB_ISBUTTONENABLED      (WM_USER + 9)
  796.     #define TB_ISBUTTONCHECKED      (WM_USER + 10)
  797.     #define TB_ISBUTTONPRESSED      (WM_USER + 11)
  798.     #define TB_ISBUTTONHIDDEN       (WM_USER + 12)
  799.     #define TB_ISBUTTONINDETERMINATE (WM_USER + 13)
  800.     #define TB_SETSTATE             (WM_USER + 17)
  801.     #define TB_GETSTATE             (WM_USER + 18)
  802.     #define TB_ADDBITMAP            (WM_USER + 19)
  803.  
  804.     #ifdef _WIN32
  805.     typedef struct tagTBADDBITMAP {
  806.             HINSTANCE       hInst;
  807.             UINT            nID;
  808.     } TBADDBITMAP, *LPTBADDBITMAP;
  809.  
  810.     #define HINST_COMMCTRL          ((HINSTANCE)-1)
  811.     #define IDB_STD_SMALL_COLOR     0
  812.     #define IDB_STD_LARGE_COLOR     1
  813.     #define IDB_VIEW_SMALL_COLOR    4
  814.     #define IDB_VIEW_LARGE_COLOR    5
  815.     #define IDB_HIST_SMALL_COLOR    8
  816.     #define IDB_HIST_LARGE_COLOR    9
  817.  
  818.     // icon indexes for standard bitmap
  819.  
  820.     #define STD_CUT                 0
  821.     #define STD_COPY                1
  822.     #define STD_PASTE               2
  823.     #define STD_UNDO                3
  824.     #define STD_REDOW               4
  825.     #define STD_DELETE              5
  826.     #define STD_FILENEW             6
  827.     #define STD_FILEOPEN            7
  828.     #define STD_FILESAVE            8
  829.     #define STD_PRINTPRE            9
  830.     #define STD_PROPERTIES          10
  831.     #define STD_HELP                11
  832.     #define STD_FIND                12
  833.     #define STD_REPLACE             13
  834.     #define STD_PRINT               14
  835.  
  836.     // icon indexes for standard view bitmap
  837.  
  838.     #define VIEW_LARGEICONS         0
  839.     #define VIEW_SMALLICONS         1
  840.     #define VIEW_LIST               2
  841.     #define VIEW_DETAILS            3
  842.     #define VIEW_SORTNAME           4
  843.     #define VIEW_SORTSIZE           5
  844.     #define VIEW_SORTDATE           6
  845.     #define VIEW_SORTTYPE           7
  846.     #define VIEW_PARENTFOLDER       8
  847.     #define VIEW_NETCONNECT         9
  848.     #define VIEW_NETDISCONNECT      10
  849.     #define VIEW_NEWFOLDER          11
  850.  
  851.     #define HIST_BACK               0
  852.     #define HIST_FORWARD            1
  853.     #define HIST_FAVORITES          2
  854.     #define HIST_ADDTOFAVORITES     3
  855.     #define HIST_VIEWTREE           4
  856.  
  857.     #endif
  858.  
  859.     #define TB_ADDBUTTONS           (WM_USER + 20)
  860.     #define TB_INSERTBUTTON         (WM_USER + 21)
  861.     #define TB_DELETEBUTTON         (WM_USER + 22)
  862.     #define TB_GETBUTTON            (WM_USER + 23)
  863.     #define TB_BUTTONCOUNT          (WM_USER + 24)
  864.     #define TB_COMMANDTOINDEX       (WM_USER + 25)
  865.  
  866.     #ifdef _WIN32
  867.  
  868.     typedef struct tagTBSAVEPARAMSA {
  869.         HKEY hkr;
  870.         LPCSTR pszSubKey;
  871.         LPCSTR pszValueName;
  872.     } TBSAVEPARAMSA, FAR* LPTBSAVEPARAMSA;
  873.  
  874.     typedef struct tagTBSAVEPARAMSW {
  875.         HKEY hkr;
  876.         LPCWSTR pszSubKey;
  877.         LPCWSTR pszValueName;
  878.     } TBSAVEPARAMSW, *LPTBSAVEPARAMW;
  879.  
  880.     #ifdef UNICODE
  881.     #define TBSAVEPARAMS            TBSAVEPARAMSW
  882.     #define LPTBSAVEPARAMS          LPTBSAVEPARAMSW
  883.     #else
  884.     #define TBSAVEPARAMS            TBSAVEPARAMSA
  885.     #define LPTBSAVEPARAMS          LPTBSAVEPARAMSA
  886.     #endif
  887.  
  888.     #endif
  889.  
  890.     #define TB_SAVERESTOREA         (WM_USER + 26)
  891.     #define TB_SAVERESTOREW         (WM_USER + 76)
  892.     #define TB_CUSTOMIZE            (WM_USER + 27)
  893.     #define TB_ADDSTRINGA           (WM_USER + 28)
  894.     #define TB_ADDSTRINGW           (WM_USER + 77)
  895.     #define TB_GETITEMRECT          (WM_USER + 29)
  896.     #define TB_BUTTONSTRUCTSIZE     (WM_USER + 30)
  897.     #define TB_SETBUTTONSIZE        (WM_USER + 31)
  898.     #define TB_SETBITMAPSIZE        (WM_USER + 32)
  899.     #define TB_AUTOSIZE             (WM_USER + 33)
  900.     #define TB_GETTOOLTIPS          (WM_USER + 35)
  901.     #define TB_SETTOOLTIPS          (WM_USER + 36)
  902.     #define TB_SETPARENT            (WM_USER + 37)
  903.     #define TB_SETROWS              (WM_USER + 39)
  904.     #define TB_GETROWS              (WM_USER + 40)
  905.     #define TB_SETCMDID             (WM_USER + 42)
  906.     #define TB_CHANGEBITMAP         (WM_USER + 43)
  907.     #define TB_GETBITMAP            (WM_USER + 44)
  908.     #define TB_GETBUTTONTEXTA       (WM_USER + 45)
  909.     #define TB_GETBUTTONTEXTW       (WM_USER + 75)
  910.     #define TB_REPLACEBITMAP        (WM_USER + 46)
  911.     #define TB_SETINDENT            (WM_USER + 47)
  912.     #define TB_SETIMAGELIST         (WM_USER + 48)
  913.     #define TB_GETIMAGELIST         (WM_USER + 49)
  914.     #define TB_LOADIMAGES           (WM_USER + 50)
  915.     #define TB_GETRECT              (WM_USER + 51) // wParam is the Cmd instead of index
  916.     #define TB_SETHOTIMAGELIST      (WM_USER + 52)
  917.     #define TB_GETHOTIMAGELIST      (WM_USER + 53)
  918.     #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
  919.     #define TB_GETDISABLEDIMAGELIST (WM_USER + 55)
  920.     #define TB_SETSTYLE             (WM_USER + 56)
  921.     #define TB_GETSTYLE             (WM_USER + 57)
  922.     #define TB_GETBUTTONSIZE        (WM_USER + 58)
  923.     #define TB_SETBUTTONWIDTH       (WM_USER + 59)
  924.     #define TB_SETMAXTEXTROWS       (WM_USER + 60)
  925.     #define TB_GETTEXTROWS          (WM_USER + 61)
  926.     #ifdef UNICODE
  927.     #define TB_GETBUTTONTEXT        TB_GETBUTTONTEXTW
  928.     #define TB_SAVERESTORE          TB_SAVERESTOREW
  929.     #define TB_ADDSTRING            TB_ADDSTRINGW
  930.     #else
  931.     #define TB_GETBUTTONTEXT        TB_GETBUTTONTEXTA
  932.     #define TB_SAVERESTORE          TB_SAVERESTOREA
  933.     #define TB_ADDSTRING            TB_ADDSTRINGA
  934.     #endif
  935.  
  936.     typedef struct {
  937.             HINSTANCE       hInstOld;
  938.             UINT            nIDOld;
  939.             HINSTANCE       hInstNew;
  940.             UINT            nIDNew;
  941.             int             nButtons;
  942.     } TBREPLACEBITMAP, *LPTBREPLACEBITMAP;
  943.  
  944.     #ifdef _WIN32
  945.  
  946.     #define TBBF_LARGE              0x0001
  947.  
  948.     #define TB_GETBITMAPFLAGS       (WM_USER + 41)
  949.  
  950.     #define TBN_GETBUTTONINFOA      (TBN_FIRST-0)
  951.     #define TBN_GETBUTTONINFOW      (TBN_FIRST-20)
  952.     #define TBN_BEGINDRAG           (TBN_FIRST-1)
  953.     #define TBN_ENDDRAG             (TBN_FIRST-2)
  954.     #define TBN_BEGINADJUST         (TBN_FIRST-3)
  955.     #define TBN_ENDADJUST           (TBN_FIRST-4)
  956.     #define TBN_RESET               (TBN_FIRST-5)
  957.     #define TBN_QUERYINSERT         (TBN_FIRST-6)
  958.     #define TBN_QUERYDELETE         (TBN_FIRST-7)
  959.     #define TBN_TOOLBARCHANGE       (TBN_FIRST-8)
  960.     #define TBN_CUSTHELP            (TBN_FIRST-9)
  961.     #define TBN_DROPDOWN            (TBN_FIRST - 10)
  962.     #define TBN_CLOSEUP             (TBN_FIRST - 11)
  963.  
  964.     #ifdef UNICODE
  965.     #define TBN_GETBUTTONINFO       TBN_GETBUTTONINFOW
  966.     #else
  967.     #define TBN_GETBUTTONINFO       TBN_GETBUTTONINFOA
  968.     #endif
  969.  
  970.     typedef struct tagNMTOOLBARA {
  971.         NMHDR   hdr;
  972.         int     iItem;
  973.         TBBUTTON tbButton;
  974.         int     cchText;
  975.         LPSTR   pszText;
  976.     } NMTOOLBARA, FAR* LPNMTOOLBARA;
  977.  
  978.  
  979.     typedef struct tagNMTOOLBARW {
  980.         NMHDR   hdr;
  981.         int     iItem;
  982.         TBBUTTON tbButton;
  983.         int     cchText;
  984.         LPWSTR   pszText;
  985.     } NMTOOLBARW, FAR* LPNMTOOLBARW;
  986.  
  987.     #ifdef UNICODE
  988.     #define NMTOOLBAR               NMTOOLBARW
  989.     #define LPNMTOOLBAR             LPNMTOOLBARW
  990.     #else
  991.     #define NMTOOLBAR               NMTOOLBARA
  992.     #define LPNMTOOLBAR             LPNMTOOLBARA
  993.     #endif
  994.  
  995.     #define TBNOTIFYA NMTOOLBARA
  996.     #define TBNOTIFYW NMTOOLBARW
  997.     #define TBNOTIFY  NMTOOLBAR
  998.     #define LPTBNOTIFY  LPNMTOOLBAR
  999.     #define LPTBNOTIFYA LPNMTOOLBARA
  1000.     #define LPTBNOTIFYW LPNMTOOLBARW
  1001.  
  1002.     #endif
  1003.  
  1004.     #endif
  1005.  
  1006.  
  1007.     //====== REBAR CONTROL =====
  1008.  
  1009.     #define NOREBAR
  1010.     #ifndef NOREBAR
  1011.  
  1012.     #define RBIM_IMAGELIST  0x00000001
  1013.  
  1014.     #define RBS_TOOLTIPS    0x00000100
  1015.     #define RBS_VARHEIGHT   0x00000200
  1016.     #define RBS_BANDBORDERS 0x00000400
  1017.     #define RBS_FIXEDORDER  0x00000800
  1018.  
  1019.     typedef struct tagREBARINFO
  1020.     {
  1021.         UINT        cbSize;
  1022.         UINT        fMask;
  1023.         HIMAGELIST  himl;
  1024.     }   REBARINFO, *LPREBARINFO;
  1025.  
  1026.     #define RBBS_BREAK      0x00000001  // break to new line
  1027.     #define RBBS_FIXEDSIZE  0x00000002  // band can't be sized
  1028.     #define RBBS_CHILDEDGE  0x00000004  // edge around top & bottom of child window
  1029.     #define RBBS_HIDDEN     0x00000008  // don't show
  1030.     #define RBBS_NOVERT     0x00000010  // don't show when vertical
  1031.     #define RBBS_FIXEDBMP   0x00000020  // bitmap doesn't move during band resize
  1032.  
  1033.     #define RBBIM_STYLE     0x00000001
  1034.     #define RBBIM_COLORS    0x00000002
  1035.     #define RBBIM_TEXT      0x00000004
  1036.     #define RBBIM_IMAGE     0x00000008
  1037.     #define RBBIM_CHILD     0x00000010
  1038.     #define RBBIM_CHILDSIZE 0x00000020
  1039.     #define RBBIM_SIZE      0x00000040
  1040.     #define RBBIM_BACKGROUND 0x00000080
  1041.     #define RBBIM_ID        0x00000100
  1042.  
  1043.     typedef struct tagREBARBANDINFOA
  1044.     {
  1045.         UINT        cbSize;
  1046.         UINT        fMask;
  1047.         UINT        fStyle;
  1048.         COLORREF    clrFore;
  1049.         COLORREF    clrBack;
  1050.         LPSTR       lpText;
  1051.         UINT        cch;
  1052.         int         iImage;
  1053.         HWND        hwndChild;
  1054.         UINT        cxMinChild;
  1055.         UINT        cyMinChild;
  1056.         UINT        cx;
  1057.         HBITMAP     hbmBack;
  1058.         UINT        wID;
  1059.     }   REBARBANDINFOA, *LPREBARBANDINFOA;
  1060.     typedef REBARBANDINFOA CONST *LPCREBARBANDINFOA;
  1061.  
  1062.     typedef struct tagREBARBANDINFOW
  1063.     {
  1064.         UINT        cbSize;
  1065.         UINT        fMask;
  1066.         UINT        fStyle;
  1067.         COLORREF    clrFore;
  1068.         COLORREF    clrBack;
  1069.         LPWSTR      lpText;
  1070.         UINT        cch;
  1071.         int         iImage;
  1072.         HWND        hwndChild;
  1073.         UINT        cxMinChild;
  1074.         UINT        cyMinChild;
  1075.         UINT        cx;
  1076.         HBITMAP     hbmBack;
  1077.         UINT        wID;
  1078.     }   REBARBANDINFOW, *LPREBARBANDINFOW;
  1079.     typedef REBARBANDINFOW CONST *LPCREBARBANDINFOW;
  1080.  
  1081.     #ifdef UNICODE
  1082.     #define REBARBANDINFO       REBARBANDINFOW
  1083.     #define LPREBARBANDINFO     LPREBARBANDINFOW
  1084.     #define LPCREBARBANDINFO    LPCREBARBANDINFOW
  1085.     #else
  1086.     #define REBARBANDINFO       REBARBANDINFOA
  1087.     #define LPREBARBANDINFO     LPREBARBANDINFOA
  1088.     #define LPCREBARBANDINFO    LPCREBARBANDINFOA
  1089.     #endif
  1090.  
  1091.     #define RB_INSERTBANDA  (WM_USER +  1)
  1092.     #define RB_DELETEBAND   (WM_USER +  2)
  1093.     #define RB_GETBARINFO   (WM_USER +  3)
  1094.     #define RB_SETBARINFO   (WM_USER +  4)
  1095.     #define RB_GETBANDINFO  (WM_USER +  5)
  1096.     #define RB_SETBANDINFOA (WM_USER +  6)
  1097.     #define RB_SETPARENT    (WM_USER +  7)
  1098.     #define RB_INSERTBANDW  (WM_USER +  10)
  1099.     #define RB_SETBANDINFOW (WM_USER +  11)
  1100.     #define RB_GETBANDCOUNT (WM_USER +  12)
  1101.     #define RB_GETROWCOUNT  (WM_USER +  13)
  1102.     #define RB_GETROWHEIGHT (WM_USER +  14)
  1103.  
  1104.     #ifdef UNICODE
  1105.     #define RB_INSERTBAND   RB_INSERTBANDW
  1106.     #define RB_SETBANDINFO   RB_SETBANDINFOW
  1107.     #else
  1108.     #define RB_INSERTBAND   RB_INSERTBANDA
  1109.     #define RB_SETBANDINFO   RB_SETBANDINFOA
  1110.     #endif
  1111.  
  1112.     #define RBN_HEIGHTCHANGE    (RBN_FIRST - 0)
  1113.  
  1114.     #endif
  1115.  
  1116.     //====== TOOLTIPS CONTROL ==========
  1117.  
  1118.     #define NOTOOLTIPS
  1119.     #ifndef NOTOOLTIPS
  1120.  
  1121.     typedef struct tagTOOLINFOA {
  1122.         UINT cbSize;
  1123.         UINT uFlags;
  1124.         HWND hwnd;
  1125.         UINT uId;
  1126.         RECT rect;
  1127.         HINSTANCE hinst;
  1128.         LPSTR lpszText;
  1129.         LPARAM lParam;
  1130.     } TTTOOLINFOA, NEAR *PTOOLINFOA, *LPTTTOOLINFOA;
  1131.  
  1132.     typedef struct tagTOOLINFOW {
  1133.         UINT cbSize;
  1134.         UINT uFlags;
  1135.         HWND hwnd;
  1136.         UINT uId;
  1137.         RECT rect;
  1138.         HINSTANCE hinst;
  1139.         LPWSTR lpszText;
  1140.         LPARAM lParam;
  1141.     } TTTOOLINFOW, NEAR *PTOOLINFOW, FAR* LPTTTOOLINFOW;
  1142.  
  1143.     #ifdef UNICODE
  1144.     #define TTTOOLINFO              TTTOOLINFOW
  1145.     #define PTOOLINFO               PTOOLINFOW
  1146.     #define LPTTTOOLINFO            LPTTTOOLINFOW
  1147.     #else
  1148.     #define PTOOLINFO               PTOOLINFOA
  1149.     #define TTTOOLINFO              TTTOOLINFOA
  1150.     #define LPTTTOOLINFO            LPTTTOOLINFOA
  1151.     #endif
  1152.  
  1153.  
  1154.     #define LPTOOLINFO              LPTTTOOLINFO
  1155.     #define LPTOOLINFOA             LPTTTOOLINFOA
  1156.     #define LPTOOLINFOW             LPTTTOOLINFOW
  1157.     #define TOOLINFO                TTTOOLINFO
  1158.     #define TOOLINFOA               TTTOOLINFOA
  1159.     #define TOOLINFOW               TTTOOLINFOW
  1160.  
  1161.  
  1162.     #define TTS_ALWAYSTIP           0x01
  1163.     #define TTS_NOPREFIX            0x02
  1164.  
  1165.     #define TTF_IDISHWND            0x0001
  1166.  
  1167.     // Use this to center around trackpoint in trackmode
  1168.     // -OR- to center around tool in normal mode.
  1169.     // Use TTF_ABSOLUTE to place the tip exactly at the track coords when
  1170.     // in tracking mode.  TTF_ABSOLUTE can be used in conjunction with TTF_CENTERTIP
  1171.     // to center the tip absolutely about the track point.
  1172.  
  1173.     #define TTF_CENTERTIP           0x0002
  1174.     #define TTF_RTLREADING          0x0004
  1175.     #define TTF_SUBCLASS            0x0010
  1176.     #define TTF_TRACK               0x0020
  1177.     #define TTF_ABSOLUTE            0x0080
  1178.     #define TTF_TRANSPARENT         0x0100
  1179.     #define TTF_DI_SETITEM          0x8000       // valid only on the TTN_NEEDTEXT callback
  1180.  
  1181.     #define TTDT_AUTOMATIC          0
  1182.     #define TTDT_RESHOW             1
  1183.     #define TTDT_AUTOPOP            2
  1184.     #define TTDT_INITIAL            3
  1185.  
  1186.     #define TTM_ACTIVATE            (WM_USER + 1)
  1187.     #define TTM_SETDELAYTIME        (WM_USER + 3)
  1188.     #define TTM_ADDTOOLA            (WM_USER + 4)
  1189.     #define TTM_ADDTOOLW            (WM_USER + 50)
  1190.     #define TTM_DELTOOLA            (WM_USER + 5)
  1191.     #define TTM_DELTOOLW            (WM_USER + 51)
  1192.     #define TTM_NEWTOOLRECTA        (WM_USER + 6)
  1193.     #define TTM_NEWTOOLRECTW        (WM_USER + 52)
  1194.     #define TTM_RELAYEVENT          (WM_USER + 7)
  1195.  
  1196.     #define TTM_GETTOOLINFOA        (WM_USER + 8)
  1197.     #define TTM_GETTOOLINFOW        (WM_USER + 53)
  1198.  
  1199.     #define TTM_SETTOOLINFOA        (WM_USER + 9)
  1200.     #define TTM_SETTOOLINFOW        (WM_USER + 54)
  1201.  
  1202.     #define TTM_HITTESTA            (WM_USER +10)
  1203.     #define TTM_HITTESTW            (WM_USER +55)
  1204.     #define TTM_GETTEXTA            (WM_USER +11)
  1205.     #define TTM_GETTEXTW            (WM_USER +56)
  1206.     #define TTM_UPDATETIPTEXTA      (WM_USER +12)
  1207.     #define TTM_UPDATETIPTEXTW      (WM_USER +57)
  1208.     #define TTM_GETTOOLCOUNT        (WM_USER +13)
  1209.     #define TTM_ENUMTOOLSA          (WM_USER +14)
  1210.     #define TTM_ENUMTOOLSW          (WM_USER +58)
  1211.     #define TTM_GETCURRENTTOOLA     (WM_USER + 15)
  1212.     #define TTM_GETCURRENTTOOLW     (WM_USER + 59)
  1213.     #define TTM_WINDOWFROMPOINT     (WM_USER + 16)
  1214.     #define TTM_TRACKACTIVATE       (WM_USER + 17)  // wParam = TRUE/FALSE start end  lparam = LPTOOLINFO
  1215.     #define TTM_TRACKPOSITION       (WM_USER + 18)  // lParam = dwPos
  1216.     #define TTM_SETTIPBKCOLOR       (WM_USER + 19)
  1217.     #define TTM_SETTIPTEXTCOLOR     (WM_USER + 20)
  1218.     #define TTM_GETDELAYTIME        (WM_USER + 21)
  1219.     #define TTM_GETTIPBKCOLOR       (WM_USER + 22)
  1220.     #define TTM_GETTIPTEXTCOLOR     (WM_USER + 23)
  1221.     #define TTM_SETMAXTIPWIDTH      (WM_USER + 24)
  1222.     #define TTM_GETMAXTIPWIDTH      (WM_USER + 25)
  1223.     #define TTM_SETMARGIN           (WM_USER + 26)  // lParam = lprc
  1224.     #define TTM_GETMARGIN           (WM_USER + 27)  // lParam = lprc
  1225.     #define TTM_POP                 (WM_USER + 28)
  1226.  
  1227.  
  1228.     #ifdef UNICODE
  1229.     #define TTM_ADDTOOL             TTM_ADDTOOLW
  1230.     #define TTM_DELTOOL             TTM_DELTOOLW
  1231.     #define TTM_NEWTOOLRECT         TTM_NEWTOOLRECTW
  1232.     #define TTM_GETTOOLINFO         TTM_GETTOOLINFOW
  1233.     #define TTM_SETTOOLINFO         TTM_SETTOOLINFOW
  1234.     #define TTM_HITTEST             TTM_HITTESTW
  1235.     #define TTM_GETTEXT             TTM_GETTEXTW
  1236.     #define TTM_UPDATETIPTEXT       TTM_UPDATETIPTEXTW
  1237.     #define TTM_ENUMTOOLS           TTM_ENUMTOOLSW
  1238.     #define TTM_GETCURRENTTOOL      TTM_GETCURRENTTOOLW
  1239.     #else
  1240.     #define TTM_ADDTOOL             TTM_ADDTOOLA
  1241.     #define TTM_DELTOOL             TTM_DELTOOLA
  1242.     #define TTM_NEWTOOLRECT         TTM_NEWTOOLRECTA
  1243.     #define TTM_GETTOOLINFO         TTM_GETTOOLINFOA
  1244.     #define TTM_SETTOOLINFO         TTM_SETTOOLINFOA
  1245.     #define TTM_HITTEST             TTM_HITTESTA
  1246.     #define TTM_GETTEXT             TTM_GETTEXTA
  1247.     #define TTM_UPDATETIPTEXT       TTM_UPDATETIPTEXTA
  1248.     #define TTM_ENUMTOOLS           TTM_ENUMTOOLSA
  1249.     #define TTM_GETCURRENTTOOL      TTM_GETCURRENTTOOLA
  1250.     #endif
  1251.  
  1252.  
  1253.     typedef struct _TT_HITTESTINFOA {
  1254.         HWND hwnd;
  1255.         POINT pt;
  1256.         TTTOOLINFOA ti;
  1257.     } TTHITTESTINFOA, * LPTTHITTESTINFOA;
  1258.  
  1259.     typedef struct _TT_HITTESTINFOW {
  1260.         HWND hwnd;
  1261.         POINT pt;
  1262.         TTTOOLINFOW ti;
  1263.     } TTHITTESTINFOW, * LPTTHITTESTINFOW;
  1264.  
  1265.     #define LPHITTESTINFOW          LPTTHITTESTINFOW
  1266.     #define LPHITTESTINFOA          LPTTHITTESTINFOA
  1267.     #define LPHITTESTINFO           LPTTHITTESTINFO
  1268.  
  1269.     #ifdef UNICODE
  1270.     #define TTHITTESTINFO           TTHITTESTINFOW
  1271.     #define LPTTHITTESTINFO         LPTTHITTESTINFOW
  1272.     #else
  1273.     #define TTHITTESTINFO           TTHITTESTINFOA
  1274.     #define LPTTHITTESTINFO         LPTTHITTESTINFOA
  1275.     #endif
  1276.  
  1277.     #define TTN_GETDISPINFOA        (TTN_FIRST - 0)
  1278.     #define TTN_GETDISPINFOW        (TTN_FIRST - 10)
  1279.     #define TTN_SHOW                (TTN_FIRST - 1)
  1280.     #define TTN_POP                 (TTN_FIRST - 2)
  1281.  
  1282.  
  1283.     #ifdef UNICODE
  1284.     #define TTN_GETDISPINFO         TTN_GETDISPINFOW
  1285.     #else
  1286.     #define TTN_GETDISPINFO         TTN_GETDISPINFOA
  1287.     #endif
  1288.  
  1289.     #define TTN_NEEDTEXT            TTN_GETDISPINFO
  1290.     #define TTN_NEEDTEXTA           TTN_GETDISPINFOA
  1291.     #define TTN_NEEDTEXTW           TTN_GETDISPINFOW
  1292.  
  1293.  
  1294.     typedef struct tagNMTTDISPIFNOA {
  1295.         NMHDR hdr;
  1296.         LPSTR lpszText;
  1297.         char szText[80];
  1298.         HINSTANCE hinst;
  1299.         UINT uFlags;
  1300.         LPARAM lParam;
  1301.     } NMTTDISPINFOA, *LPNMTTDISPINFOA;
  1302.  
  1303.  
  1304.     typedef struct tagNMTTDISPINFOW {
  1305.         NMHDR hdr;
  1306.         LPWSTR lpszText;
  1307.         WCHAR szText[80];
  1308.         HINSTANCE hinst;
  1309.         UINT uFlags;
  1310.         LPARAM lParam;
  1311.     } NMTTDISPINFOW, *LPNMTTDISPINFOW;
  1312.  
  1313.     #define TOOLTIPTEXTW NMTTDISPINFOW
  1314.     #define TOOLTIPTEXTA NMTTDISPINFOA
  1315.     #define TOOLTIPTEXT  NMTTDISPINFO
  1316.     #define LPTOOLTIPTEXT  LPNMTTDISPINFO
  1317.     #define LPTOOLTIPTEXTA LPNMTTDISPINFOA
  1318.     #define LPTOOLTIPTEXTW LPNMTTDISPINFOW
  1319.  
  1320.  
  1321.     #ifdef UNICODE
  1322.     #define NMTTDISPINFO            NMTTDISPINFOW
  1323.     #define LPNMTTDISPINFO          LPNMTTDISPINFOW
  1324.     #else
  1325.     #define NMTTDISPINFO            NMTTDISPINFOA
  1326.     #define LPNMTTDISPINFO          LPNMTTDISPINFOA
  1327.     #endif
  1328.  
  1329.     #endif
  1330.  
  1331.  
  1332.     //====== STATUS BAR CONTROL ========
  1333.  
  1334.     #define NOSTATUSBAR
  1335.     #ifndef NOSTATUSBAR
  1336.  
  1337.     #define SBARS_SIZEGRIP          0x0100
  1338.  
  1339.  
  1340.     WINCOMMCTRLAPI void WINAPI DrawStatusTextA(HDC hDC, LPRECT lprc, LPCSTR pszText, UINT uFlags);
  1341.     WINCOMMCTRLAPI void WINAPI DrawStatusTextW(HDC hDC, LPRECT lprc, LPCWSTR pszText, UINT uFlags);
  1342.  
  1343.     WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style, LPCSTR lpszText, HWND hwndParent, UINT wID);
  1344.     WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID);
  1345.  
  1346.     #ifdef UNICODE
  1347.     #define CreateStatusWindow      CreateStatusWindowW
  1348.     #define DrawStatusText          DrawStatusTextW
  1349.     #else
  1350.     #define CreateStatusWindow      CreateStatusWindowA
  1351.     #define DrawStatusText          DrawStatusTextA
  1352.     #endif
  1353.  
  1354.     #define SB_SETTEXTA             (WM_USER+1)
  1355.     #define SB_SETTEXTW             (WM_USER+11)
  1356.     #define SB_GETTEXTA             (WM_USER+2)
  1357.     #define SB_GETTEXTW             (WM_USER+13)
  1358.     #define SB_GETTEXTLENGTHA       (WM_USER+3)
  1359.     #define SB_GETTEXTLENGTHW       (WM_USER+12)
  1360.  
  1361.     #ifdef UNICODE
  1362.     #define SB_GETTEXT              SB_GETTEXTW
  1363.     #define SB_SETTEXT              SB_SETTEXTW
  1364.     #define SB_GETTEXTLENGTH        SB_GETTEXTLENGTHW
  1365.     #else
  1366.     #define SB_GETTEXT              SB_GETTEXTA
  1367.     #define SB_SETTEXT              SB_SETTEXTA
  1368.     #define SB_GETTEXTLENGTH        SB_GETTEXTLENGTHA
  1369.     #endif
  1370.  
  1371.  
  1372.     #define SB_SETPARTS             (WM_USER+4)
  1373.     #define SB_GETPARTS             (WM_USER+6)
  1374.     #define SB_GETBORDERS           (WM_USER+7)
  1375.     #define SB_SETMINHEIGHT         (WM_USER+8)
  1376.     #define SB_SIMPLE               (WM_USER+9)
  1377.     #define SB_GETRECT              (WM_USER+10)
  1378.     #define SB_ISSIMPLE             (WM_USER+14)
  1379.  
  1380.  
  1381.     #define SBT_OWNERDRAW            0x1000
  1382.     #define SBT_NOBORDERS            0x0100
  1383.     #define SBT_POPOUT               0x0200
  1384.     #define SBT_RTLREADING           0x0400
  1385.  
  1386.     #endif
  1387.  
  1388.     //====== MENU HELP =========
  1389.  
  1390.     #define NOMENUHELP
  1391.     #ifndef NOMENUHELP
  1392.  
  1393.     WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT *lpwIDs);
  1394.     WINCOMMCTRLAPI BOOL WINAPI ShowHideMenuCtl(HWND hWnd, UINT uFlags, LPINT lpInfo);
  1395.     WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd, LPRECT lprc, LPINT lpInfo);
  1396.  
  1397.     #define MINSYSCOMMAND   SC_SIZE
  1398.  
  1399.     #endif
  1400.  
  1401.  
  1402.     //====== TRACKBAR CONTROL ==========
  1403.  
  1404.     #define NOTRACKBAR
  1405.     #ifndef NOTRACKBAR
  1406.  
  1407.     #define TBS_AUTOTICKS           0x0001
  1408.     #define TBS_VERT                0x0002
  1409.     #define TBS_HORZ                0x0000
  1410.     #define TBS_TOP                 0x0004
  1411.     #define TBS_BOTTOM              0x0000
  1412.     #define TBS_LEFT                0x0004
  1413.     #define TBS_RIGHT               0x0000
  1414.     #define TBS_BOTH                0x0008
  1415.     #define TBS_NOTICKS             0x0010
  1416.     #define TBS_ENABLESELRANGE      0x0020
  1417.     #define TBS_FIXEDLENGTH         0x0040
  1418.     #define TBS_NOTHUMB             0x0080
  1419.     #define TBS_TOOLTIPS            0x0100
  1420.  
  1421.     #define TBM_GETPOS              (WM_USER)
  1422.     #define TBM_GETRANGEMIN         (WM_USER+1)
  1423.     #define TBM_GETRANGEMAX         (WM_USER+2)
  1424.     #define TBM_GETTIC              (WM_USER+3)
  1425.     #define TBM_SETTIC              (WM_USER+4)
  1426.     #define TBM_SETPOS              (WM_USER+5)
  1427.     #define TBM_SETRANGE            (WM_USER+6)
  1428.     #define TBM_SETRANGEMIN         (WM_USER+7)
  1429.     #define TBM_SETRANGEMAX         (WM_USER+8)
  1430.     #define TBM_CLEARTICS           (WM_USER+9)
  1431.     #define TBM_SETSEL              (WM_USER+10)
  1432.     #define TBM_SETSELSTART         (WM_USER+11)
  1433.     #define TBM_SETSELEND           (WM_USER+12)
  1434.     #define TBM_GETPTICS            (WM_USER+14)
  1435.     #define TBM_GETTICPOS           (WM_USER+15)
  1436.     #define TBM_GETNUMTICS          (WM_USER+16)
  1437.     #define TBM_GETSELSTART         (WM_USER+17)
  1438.     #define TBM_GETSELEND           (WM_USER+18)
  1439.     #define TBM_CLEARSEL            (WM_USER+19)
  1440.     #define TBM_SETTICFREQ          (WM_USER+20)
  1441.     #define TBM_SETPAGESIZE         (WM_USER+21)
  1442.     #define TBM_GETPAGESIZE         (WM_USER+22)
  1443.     #define TBM_SETLINESIZE         (WM_USER+23)
  1444.     #define TBM_GETLINESIZE         (WM_USER+24)
  1445.     #define TBM_GETTHUMBRECT        (WM_USER+25)
  1446.     #define TBM_GETCHANNELRECT      (WM_USER+26)
  1447.     #define TBM_SETTHUMBLENGTH      (WM_USER+27)
  1448.     #define TBM_GETTHUMBLENGTH      (WM_USER+28)
  1449.     #define TBM_SETTOOLTIPS         (WM_USER+29)
  1450.     #define TBM_GETTOOLTIPS         (WM_USER+30)
  1451.     #define TBM_SETTIPSIDE          (WM_USER+31)
  1452.     // TrackBar Tip Side flags
  1453.     #define TBTS_TOP                0
  1454.     #define TBTS_LEFT               1
  1455.     #define TBTS_BOTTOM             2
  1456.     #define TBTS_RIGHT              3
  1457.  
  1458.     #define TBM_SETBUDDY            (WM_USER+32) // wparam = BOOL fLeft; (or right)
  1459.     #define TBM_GETBUDDY            (WM_USER+33) // wparam = BOOL fLeft; (or right)
  1460.  
  1461.  
  1462.     #define TB_LINEUP               0
  1463.     #define TB_LINEDOWN             1
  1464.     #define TB_PAGEUP               2
  1465.     #define TB_PAGEDOWN             3
  1466.     #define TB_THUMBPOSITION        4
  1467.     #define TB_THUMBTRACK           5
  1468.     #define TB_TOP                  6
  1469.     #define TB_BOTTOM               7
  1470.     #define TB_ENDTRACK             8
  1471.  
  1472.  
  1473.     // custom draw item specs
  1474.     #define TBCD_TICS    0x0001
  1475.     #define TBCD_THUMB   0x0002
  1476.     #define TBCD_CHANNEL 0x0003
  1477.  
  1478.     #endif // trackbar
  1479.  
  1480.     //====== DRAG LIST CONTROL =========
  1481.  
  1482.     #define NODRAGLIST
  1483.     #ifndef NODRAGLIST
  1484.  
  1485.     typedef struct tagDRAGLISTINFO {
  1486.         UINT uNotification;
  1487.         HWND hWnd;
  1488.         POINT ptCursor;
  1489.     } DRAGLISTINFO, *LPDRAGLISTINFO;
  1490.  
  1491.     #define DL_BEGINDRAG            (WM_USER+133)
  1492.     #define DL_DRAGGING             (WM_USER+134)
  1493.     #define DL_DROPPED              (WM_USER+135)
  1494.     #define DL_CANCELDRAG           (WM_USER+136)
  1495.  
  1496.     #define DL_CURSORSET            0
  1497.     #define DL_STOPCURSOR           1
  1498.     #define DL_COPYCURSOR           2
  1499.     #define DL_MOVECURSOR           3
  1500.  
  1501.     #define DRAGLISTMSGSTRING       TEXT("commctrl_DragListMsg")
  1502.  
  1503.     WINCOMMCTRLAPI BOOL WINAPI MakeDragList(HWND hLB);
  1504.     WINCOMMCTRLAPI void WINAPI DrawInsert(HWND handParent, HWND hLB, int nItem);
  1505.     WINCOMMCTRLAPI int WINAPI LBItemFromPt(HWND hLB, POINT pt, BOOL bAutoScroll);
  1506.  
  1507.     #endif
  1508.  
  1509.  
  1510.     //====== UPDOWN CONTROL ============
  1511.  
  1512.     #define NOUPDOWN
  1513.     #ifndef NOUPDOWN
  1514.  
  1515.     typedef struct _UDACCEL {
  1516.         UINT nSec;
  1517.         UINT nInc;
  1518.     } UDACCEL, *LPUDACCEL;
  1519.  
  1520.     #define UD_MAXVAL               0x7fff
  1521.     #define UD_MINVAL               (-UD_MAXVAL)
  1522.  
  1523.  
  1524.     #define UDS_WRAP                0x0001
  1525.     #define UDS_SETBUDDYINT         0x0002
  1526.     #define UDS_ALIGNRIGHT          0x0004
  1527.     #define UDS_ALIGNLEFT           0x0008
  1528.     #define UDS_AUTOBUDDY           0x0010
  1529.     #define UDS_ARROWKEYS           0x0020
  1530.     #define UDS_HORZ                0x0040
  1531.     #define UDS_NOTHOUSANDS         0x0080
  1532.     #define UDS_HOTTRACK            0x0100
  1533.  
  1534.  
  1535.     #define UDM_SETRANGE            (WM_USER+101)
  1536.     #define UDM_GETRANGE            (WM_USER+102)
  1537.     #define UDM_SETPOS              (WM_USER+103)
  1538.     #define UDM_GETPOS              (WM_USER+104)
  1539.     #define UDM_SETBUDDY            (WM_USER+105)
  1540.     #define UDM_GETBUDDY            (WM_USER+106)
  1541.     #define UDM_SETACCEL            (WM_USER+107)
  1542.     #define UDM_GETACCEL            (WM_USER+108)
  1543.     #define UDM_SETBASE             (WM_USER+109)
  1544.     #define UDM_GETBASE             (WM_USER+110)
  1545.  
  1546.  
  1547.     WINCOMMCTRLAPI HWND WINAPI CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy,
  1548.                                     HWND hParent, int nID, HINSTANCE hInst,
  1549.                                     HWND hBuddy,
  1550.                                     int nUpper, int nLower, int nPos);
  1551.  
  1552.     typedef struct _NM_UPDOWN
  1553.     {
  1554.         NMHDR hdr;
  1555.         int iPos;
  1556.         int iDelta;
  1557.     } NMUPDOWN, *LPNMUPDOWN;
  1558.  
  1559.     #define NM_UPDOWN NMUPDOWN
  1560.     #define LPNM_UPDOWN LPNMUPDOWN
  1561.  
  1562.     #define UDN_DELTAPOS            (UDN_FIRST - 1)
  1563.  
  1564.     #endif
  1565.  
  1566.  
  1567.     //====== PROGRESS CONTROL ==========
  1568.  
  1569.     #define NOPROGRESS
  1570.     #ifndef NOPROGRESS
  1571.  
  1572.     #define PBS_SMOOTH              0x01
  1573.     #define PBS_VERTICAL            0x04
  1574.  
  1575.     #define PBM_SETRANGE            (WM_USER+1)
  1576.     #define PBM_SETPOS              (WM_USER+2)
  1577.     #define PBM_DELTAPOS            (WM_USER+3)
  1578.     #define PBM_SETSTEP             (WM_USER+4)
  1579.     #define PBM_STEPIT              (WM_USER+5)
  1580.     #define PBM_SETRANGE32          (WM_USER+6)  // lParam = high, wParam = low
  1581.     typedef struct
  1582.     {
  1583.        int iLow;
  1584.        int iHigh;
  1585.     } PBRANGE, *PPBRANGE;
  1586.     #define PBM_GETRANGE            (WM_USER+7)  // wParam = return (TRUE ? low : high). lParam = PPBRANGE or NULL
  1587.     #define PBM_GETPOS              (WM_USER+8)
  1588.  
  1589.     #endif
  1590.  
  1591.  
  1592.     //====== HOTKEY CONTROL ============
  1593.  
  1594.     #define NOHOTKEY
  1595.     #ifndef NOHOTKEY
  1596.  
  1597.     #define HOTKEYF_SHIFT           0x01
  1598.     #define HOTKEYF_CONTROL         0x02
  1599.     #define HOTKEYF_ALT             0x04
  1600.     #define HOTKEYF_EXT             0x08
  1601.  
  1602.     #define HKCOMB_NONE             0x0001
  1603.     #define HKCOMB_S                0x0002
  1604.     #define HKCOMB_C                0x0004
  1605.     #define HKCOMB_A                0x0008
  1606.     #define HKCOMB_SC               0x0010
  1607.     #define HKCOMB_SA               0x0020
  1608.     #define HKCOMB_CA               0x0040
  1609.     #define HKCOMB_SCA              0x0080
  1610.  
  1611.  
  1612.     #define HKM_SETHOTKEY           (WM_USER+1)
  1613.     #define HKM_GETHOTKEY           (WM_USER+2)
  1614.     #define HKM_SETRULES            (WM_USER+3)
  1615.  
  1616.     #endif
  1617.  
  1618.  
  1619.     //====== COMMON CONTROL STYLES =========
  1620.  
  1621.     #define CCS_TOP                 0x00000001L
  1622.     #define CCS_NOMOVEY             0x00000002L
  1623.     #define CCS_BOTTOM              0x00000003L
  1624.     #define CCS_NORESIZE            0x00000004L
  1625.     #define CCS_NOPARENTALIGN       0x00000008L
  1626.     #define CCS_ADJUSTABLE          0x00000020L
  1627.     #define CCS_NODIVIDER           0x00000040L
  1628.     #define CCS_VERT                0x00000080L
  1629.     #define CCS_LEFT                (CCS_VERT | CCS_TOP)
  1630.     #define CCS_RIGHT               (CCS_VERT | CCS_BOTTOM)
  1631.     #define CCS_NOMOVEX             (CCS_VERT | CCS_NOMOVEY)
  1632.  
  1633.  
  1634.     //====== LISTVIEW CONTROL ==========
  1635.  
  1636.     #define LISTVIEW
  1637.     #ifndef NOLISTVIEW
  1638.  
  1639.  
  1640.     const DWORD LVS_ICON                = 0x0000;
  1641.     const DWORD LVS_REPORT              = 0x0001;
  1642.     const DWORD LVS_SMALLICON           = 0x0002;
  1643.     const DWORD LVS_LIST                = 0x0003;
  1644.     const DWORD LVS_TYPEMASK            = 0x0003;
  1645.     const DWORD LVS_SINGLESEL           = 0x0004;
  1646.     const DWORD LVS_SHOWSELALWAYS       = 0x0008;
  1647.     const DWORD LVS_SORTASCENDING       = 0x0010;
  1648.     const DWORD LVS_SORTDESCENDING      = 0x0020;
  1649.     const DWORD LVS_SHAREIMAGELISTS     = 0x0040;
  1650.     const DWORD LVS_NOLABELWRAP         = 0x0080;
  1651.     const DWORD LVS_AUTOARRANGE         = 0x0100;
  1652.     const DWORD LVS_EDITLABELS          = 0x0200;
  1653.     const DWORD LVS_OWNERDATA           = 0x1000;
  1654.     const DWORD LVS_NOSCROLL            = 0x2000;
  1655.  
  1656.     const DWORD LVS_TYPESTYLEMASK       = 0xfc00;
  1657.  
  1658.     const DWORD LVS_ALIGNTOP            = 0x0000;
  1659.     const DWORD LVS_ALIGNLEFT           = 0x0800;
  1660.     const DWORD LVS_ALIGNMASK           = 0x0c00;
  1661.  
  1662.     const DWORD LVS_OWNERDRAWFIXED      = 0x0400;
  1663.     const DWORD LVS_NOCOLUMNHEADER      = 0x4000;
  1664.     const DWORD LVS_NOSORTHEADER        = 0x8000;
  1665.  
  1666.     const DWORD LVM_GETBKCOLOR          = (LVM_FIRST + 0);
  1667.     /*
  1668.     //define ListView_GetBkColor(hwnd)  \
  1669.         (COLORREF)SNDMSG((hwnd), LVM_GETBKCOLOR, 0, 0L)
  1670.     */
  1671.  
  1672.     const DWORD LVM_SETBKCOLOR          = (LVM_FIRST + 1);
  1673.     /*
  1674.     //define ListView_SetBkColor(hwnd, clrBk) \
  1675.         (BOOL)SNDMSG((hwnd), LVM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk))
  1676.     */
  1677.  
  1678.     const DWORD LVM_GETIMAGELIST        = (LVM_FIRST + 2);
  1679.     /*
  1680.     //define ListView_GetImageList(hwnd, iImageList) \
  1681.         (HIMAGELIST)SNDMSG((hwnd), LVM_GETIMAGELIST, (WPARAM)(INT)(iImageList), 0L)
  1682.     */
  1683.  
  1684.     const DWORD LVSIL_NORMAL            = 0;
  1685.     const DWORD LVSIL_SMALL             = 1;
  1686.     const DWORD LVSIL_STATE             = 2;
  1687.  
  1688.     const DWORD LVM_SETIMAGELIST        = LVM_FIRST + 3;
  1689.     /*
  1690.     //define ListView_SetImageList(hwnd, himl, iImageList) \
  1691.         (HIMAGELIST)(UINT)SNDMSG((hwnd), LVM_SETIMAGELIST, (WPARAM)(iImageList), (LPARAM)(UINT)(HIMAGELIST)(himl))
  1692.     */
  1693.  
  1694.     const DWORD LVM_GETITEMCOUNT        = LVM_FIRST + 4;
  1695.     /*
  1696.     //define ListView_GetItemCount(hwnd) \
  1697.         (int)SNDMSG((hwnd), LVM_GETITEMCOUNT, 0, 0L)
  1698.     */
  1699.  
  1700.  
  1701.     #define LVIF_TEXT               0x0001
  1702.     #define LVIF_IMAGE              0x0002
  1703.     #define LVIF_PARAM              0x0004
  1704.     #define LVIF_STATE              0x0008
  1705.     #define LVIF_INDENT             0x0010
  1706.     #define LVIF_NORECOMPUTE        0x0800
  1707.  
  1708.     #define LVIS_FOCUSED            0x0001
  1709.     #define LVIS_SELECTED           0x0002
  1710.     #define LVIS_CUT                0x0004
  1711.     #define LVIS_DROPHILITED        0x0008
  1712.  
  1713.     #define LVIS_OVERLAYMASK        0x0F00
  1714.     #define LVIS_STATEIMAGEMASK     0xF000
  1715.  
  1716.     #define INDEXTOSTATEIMAGEMASK(i) ((i) << 12)
  1717.     #define I_INDENTCALLBACK        (-1)
  1718.  
  1719.     /*
  1720.     typedef struct LVITEMA
  1721.     {
  1722.         UINT mask;
  1723.         int iItem;
  1724.         int iSubItem;
  1725.         UINT state;
  1726.         UINT stateMask;
  1727.         LPSTR pszText;
  1728.         int cchTextMax;
  1729.         int iImage;
  1730.         LPARAM lParam;
  1731.         int iIndent;
  1732.     } LVITEMA, * LPLVITEMA;
  1733.  
  1734.     #define LV_ITEMA LVITEMA
  1735.  
  1736.     typedef struct LVITEMW
  1737.     {
  1738.         UINT mask;
  1739.         int iItem;
  1740.         int iSubItem;
  1741.         UINT state;
  1742.         UINT stateMask;
  1743.         LPWSTR pszText;
  1744.         int cchTextMax;
  1745.         int iImage;
  1746.         LPARAM lParam;
  1747.         int iIndent;
  1748.     } LVITEMW, * LPLVITEMW;
  1749.  
  1750.     #define LV_ITEMW LVITEMW
  1751.     #define LV_ITEM LVITEM
  1752.     */
  1753.  
  1754.  
  1755.     #ifdef UNICODE
  1756.     #define LVITEM    LVITEMW
  1757.     #define LPLVITEM  LPLVITEMW
  1758.     #else
  1759.     #define LVITEM    LVITEMA
  1760.     #define LPLVITEM  LPLVITEMA
  1761.     #endif
  1762.  
  1763.  
  1764.  
  1765.     #define LPSTR_TEXTCALLBACKW     ((LPWSTR)-1L)
  1766.     #define LPSTR_TEXTCALLBACKA     ((LPSTR)-1L)
  1767.     #ifdef UNICODE
  1768.     #define LPSTR_TEXTCALLBACK      LPSTR_TEXTCALLBACKW
  1769.     #else
  1770.     #define LPSTR_TEXTCALLBACK      LPSTR_TEXTCALLBACKA
  1771.     #endif
  1772.  
  1773.     #define I_IMAGECALLBACK         (-1)
  1774.  
  1775.     #define LVM_GETITEMA            (LVM_FIRST + 5)
  1776.     #define LVM_GETITEMW            (LVM_FIRST + 75)
  1777.     #ifdef UNICODE
  1778.     #define LVM_GETITEM             LVM_GETITEMW
  1779.     #else
  1780.     #define LVM_GETITEM             LVM_GETITEMA
  1781.     #endif
  1782.  
  1783.     /*
  1784.     //define ListView_GetItem(hwnd, pitem) \
  1785.         (BOOL)SNDMSG((hwnd), LVM_GETITEM, 0, (LPARAM)(LV_ITEM FAR*)(pitem))
  1786.     */
  1787.  
  1788.  
  1789.     #define LVM_SETITEMA            (LVM_FIRST + 6)
  1790.     #define LVM_SETITEMW            (LVM_FIRST + 76)
  1791.     #ifdef UNICODE
  1792.     #define LVM_SETITEM             LVM_SETITEMW
  1793.     #else
  1794.     #define LVM_SETITEM             LVM_SETITEMA
  1795.     #endif
  1796.  
  1797.     /*
  1798.     //define ListView_SetItem(hwnd, pitem) \
  1799.         (BOOL)SNDMSG((hwnd), LVM_SETITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  1800.     */
  1801.  
  1802.  
  1803.     #define LVM_INSERTITEMA         (LVM_FIRST + 7)
  1804.     #define LVM_INSERTITEMW         (LVM_FIRST + 77)
  1805.     #ifdef UNICODE
  1806.     #define LVM_INSERTITEM          LVM_INSERTITEMW
  1807.     #else
  1808.     #define LVM_INSERTITEM          LVM_INSERTITEMA
  1809.     #endif
  1810.     /*
  1811.     //define ListView_InsertItem(hwnd, pitem)   \
  1812.         (int)SNDMSG((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem))
  1813.     */
  1814.  
  1815.  
  1816.     #define LVM_DELETEITEM          (LVM_FIRST + 8)
  1817.     /*
  1818.     //define ListView_DeleteItem(hwnd, i) \
  1819.         (BOOL)SNDMSG((hwnd), LVM_DELETEITEM, (WPARAM)(int)(i), 0L)
  1820.     */
  1821.  
  1822.  
  1823.     #define LVM_DELETEALLITEMS      (LVM_FIRST + 9)
  1824.     /*
  1825.     //define ListView_DeleteAllItems(hwnd) \
  1826.         (BOOL)SNDMSG((hwnd), LVM_DELETEALLITEMS, 0, 0L)
  1827.     */
  1828.  
  1829.  
  1830.     #define LVM_GETCALLBACKMASK     (LVM_FIRST + 10)
  1831.     /*
  1832.     //define ListView_GetCallbackMask(hwnd) \
  1833.         (BOOL)SNDMSG((hwnd), LVM_GETCALLBACKMASK, 0, 0)
  1834.     */
  1835.  
  1836.  
  1837.     #define LVM_SETCALLBACKMASK     (LVM_FIRST + 11)
  1838.     /*
  1839.     //define ListView_SetCallbackMask(hwnd, mask) \
  1840.         (BOOL)SNDMSG((hwnd), LVM_SETCALLBACKMASK, (WPARAM)(UINT)(mask), 0)
  1841.     */
  1842.  
  1843.  
  1844.     #define LVNI_ALL                0x0000
  1845.     #define LVNI_FOCUSED            0x0001
  1846.     #define LVNI_SELECTED           0x0002
  1847.     #define LVNI_CUT                0x0004
  1848.     #define LVNI_DROPHILITED        0x0008
  1849.  
  1850.     #define LVNI_ABOVE              0x0100
  1851.     #define LVNI_BELOW              0x0200
  1852.     #define LVNI_TOLEFT             0x0400
  1853.     #define LVNI_TORIGHT            0x0800
  1854.  
  1855.  
  1856.     #define LVM_GETNEXTITEM         (LVM_FIRST + 12)
  1857.     /*
  1858.     //define ListView_GetNextItem(hwnd, i, flags) \
  1859.         (int)SNDMSG((hwnd), LVM_GETNEXTITEM, (WPARAM)(int)(i), MAKELPARAM((flags), 0))
  1860.     */
  1861.  
  1862.  
  1863.     #define LVFI_PARAM              0x0001
  1864.     #define LVFI_STRING             0x0002
  1865.     #define LVFI_PARTIAL            0x0008
  1866.     #define LVFI_WRAP               0x0020
  1867.     #define LVFI_NEARESTXY          0x0040
  1868.  
  1869.     /*
  1870.     typedef struct LVFINDINFOA
  1871.     {
  1872.         UINT flags;
  1873.         LPCSTR psz;
  1874.         LPARAM lParam;
  1875.         POINT pt;
  1876.         UINT vkDirection;
  1877.     } LVFINDINFOA, FAR* LPFINDINFOA;
  1878.  
  1879.     #define LV_FINDINFOA LVFINDINFOA
  1880.  
  1881.     typedef struct LVFINDINFOW
  1882.     {
  1883.         UINT flags;
  1884.         LPCWSTR psz;
  1885.         LPARAM lParam;
  1886.         POINT pt;
  1887.         UINT vkDirection;
  1888.     } LVFINDINFOW, FAR* LPFINDINFOW;
  1889.  
  1890.     #define LV_FINDINFOW LVFINDINFOW
  1891.     #define LV_FINDINFO  LVFINDINFO
  1892.     */
  1893.  
  1894.     #ifdef UNICODE
  1895.     #define  LVFINDINFO            LVFINDINFOW
  1896.     #else
  1897.     #define  LVFINDINFO            LVFINDINFOA
  1898.     #endif
  1899.  
  1900.     #define LVM_FINDITEMA           (LVM_FIRST + 13)
  1901.     #define LVM_FINDITEMW           (LVM_FIRST + 83)
  1902.     #ifdef UNICODE
  1903.     #define  LVM_FINDITEM           LVM_FINDITEMW
  1904.     #else
  1905.     #define  LVM_FINDITEM           LVM_FINDITEMA
  1906.     #endif
  1907.  
  1908.     /*
  1909.     //define ListView_FindItem(hwnd, iStart, plvfi) \
  1910.         (int)SNDMSG((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi))
  1911.     */
  1912.  
  1913.     const LONG LVIR_BOUNDS             = 0;
  1914.     const LONG LVIR_ICON               = 1;
  1915.     const LONG LVIR_LABEL              = 2;
  1916.     const LONG LVIR_SELECTBOUNDS       = 3;
  1917.  
  1918.  
  1919.     const LONG LVM_GETITEMRECT        = (LVM_FIRST + 14);
  1920.     /*
  1921.     //define ListView_GetItemRect(hwnd, i, prc, code) \
  1922.          (BOOL)SNDMSG((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), \
  1923.                ((prc) ? (((RECT *)(prc))->left = (code),(LPARAM)(RECT FAR*)(prc)) : (LPARAM)(RECT FAR*)NULL))
  1924.     */
  1925.  
  1926.  
  1927.     #define LVM_SETITEMPOSITION     (LVM_FIRST + 15)
  1928.     /*
  1929.     //define ListView_SetItemPosition(hwndLV, i, x, y) \
  1930.         (BOOL)SNDMSG((hwndLV), LVM_SETITEMPOSITION, (WPARAM)(int)(i), MAKELPARAM((x), (y)))
  1931.     */
  1932.  
  1933.  
  1934.     #define LVM_GETITEMPOSITION     (LVM_FIRST + 16)
  1935.     /*
  1936.     //define ListView_GetItemPosition(hwndLV, i, ppt) \
  1937.         (BOOL)SNDMSG((hwndLV), LVM_GETITEMPOSITION, (WPARAM)(int)(i), (LPARAM)(POINT FAR*)(ppt))
  1938.     */
  1939.  
  1940.  
  1941.     #define LVM_GETSTRINGWIDTHA     (LVM_FIRST + 17)
  1942.     #define LVM_GETSTRINGWIDTHW     (LVM_FIRST + 87)
  1943.     #ifdef UNICODE
  1944.     #define  LVM_GETSTRINGWIDTH     LVM_GETSTRINGWIDTHW
  1945.     #else
  1946.     #define  LVM_GETSTRINGWIDTH     LVM_GETSTRINGWIDTHA
  1947.     #endif
  1948.  
  1949.     /*
  1950.     //define ListView_GetStringWidth(hwndLV, psz) \
  1951.         (int)SNDMSG((hwndLV), LVM_GETSTRINGWIDTH, 0, (LPARAM)(LPCTSTR)(psz))
  1952.     */
  1953.  
  1954.  
  1955.     #define LVHT_NOWHERE            0x0001
  1956.     #define LVHT_ONITEMICON         0x0002
  1957.     #define LVHT_ONITEMLABEL        0x0004
  1958.     #define LVHT_ONITEMSTATEICON    0x0008
  1959.     #define LVHT_ONITEM             (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)
  1960.  
  1961.     #define LVHT_ABOVE              0x0008
  1962.     #define LVHT_BELOW              0x0010
  1963.     #define LVHT_TORIGHT            0x0020
  1964.     #define LVHT_TOLEFT             0x0040
  1965.  
  1966.     /*
  1967.     typedef struct LVHITTESTINFO
  1968.     {
  1969.         POINT pt;
  1970.         UINT flags;
  1971.         int iItem;
  1972.  
  1973.         int iSubItem;    // this is was NOT in win95.  valid only for LVM_SUBITEMHITTEST
  1974.     } LVHITTESTINFO, FAR* LPLVHITTESTINFO;
  1975.     #define LV_HITTESTINFO LVHITTESTINFO
  1976.     */
  1977.  
  1978.     #define LVM_HITTEST             (LVM_FIRST + 18)
  1979.     /*
  1980.     //define ListView_HitTest(hwndLV, pinfo) \
  1981.         (int)SNDMSG((hwndLV), LVM_HITTEST, 0, (LPARAM)(LV_HITTESTINFO FAR*)(pinfo))
  1982.     */
  1983.  
  1984.  
  1985.     #define LVM_ENSUREVISIBLE       (LVM_FIRST + 19)
  1986.     /*
  1987.     //define ListView_EnsureVisible(hwndLV, i, fPartialOK) \
  1988.         (BOOL)SNDMSG((hwndLV), LVM_ENSUREVISIBLE, (WPARAM)(int)(i), MAKELPARAM((fPartialOK), 0))
  1989.     */
  1990.  
  1991.  
  1992.     #define LVM_SCROLL              (LVM_FIRST + 20)
  1993.     /*
  1994.     //define ListView_Scroll(hwndLV, dx, dy) \
  1995.         (BOOL)SNDMSG((hwndLV), LVM_SCROLL, (WPARAM)(int)dx, (LPARAM)(int)dy)
  1996.     */
  1997.  
  1998.  
  1999.     #define LVM_REDRAWITEMS         (LVM_FIRST + 21)
  2000.     /*
  2001.     //define ListView_RedrawItems(hwndLV, iFirst, iLast) \
  2002.         (BOOL)SNDMSG((hwndLV), LVM_REDRAWITEMS, (WPARAM)(int)iFirst, (LPARAM)(int)iLast)
  2003.     */
  2004.  
  2005.  
  2006.     #define LVA_DEFAULT             0x0000
  2007.     #define LVA_ALIGNLEFT           0x0001
  2008.     #define LVA_ALIGNTOP            0x0002
  2009.     #define LVA_SNAPTOGRID          0x0005
  2010.  
  2011.  
  2012.     #define LVM_ARRANGE             (LVM_FIRST + 22)
  2013.     /*
  2014.     //define ListView_Arrange(hwndLV, code) \
  2015.         (BOOL)SNDMSG((hwndLV), LVM_ARRANGE, (WPARAM)(UINT)(code), 0L)
  2016.     */
  2017.  
  2018.  
  2019.     #define LVM_EDITLABELA          (LVM_FIRST + 23)
  2020.     #define LVM_EDITLABELW          (LVM_FIRST + 118)
  2021.     #ifdef UNICODE
  2022.     #define LVM_EDITLABEL           LVM_EDITLABELW
  2023.     #else
  2024.     #define LVM_EDITLABEL           LVM_EDITLABELA
  2025.     #endif
  2026.  
  2027.     /*
  2028.     //define ListView_EditLabel(hwndLV, i) \
  2029.         (HWND)SNDMSG((hwndLV), LVM_EDITLABEL, (WPARAM)(int)(i), 0L)
  2030.     */
  2031.  
  2032.  
  2033.     #define LVM_GETEDITCONTROL      (LVM_FIRST + 24)
  2034.     /*
  2035.     //define ListView_GetEditControl(hwndLV) \
  2036.         (HWND)SNDMSG((hwndLV), LVM_GETEDITCONTROL, 0, 0L)
  2037.     */
  2038.  
  2039.     /*
  2040.     typedef struct LVCOLUMNA
  2041.     {
  2042.         UINT mask;
  2043.         int fmt;
  2044.         int cx;
  2045.         LPSTR pszText;
  2046.         int cchTextMax;
  2047.         int iSubItem;
  2048.         int iImage;
  2049.         int iOrder;
  2050.     } LVCOLUMNA, * LPLVCOLUMNA;
  2051.  
  2052.     typedef struct LVCOLUMNW
  2053.     {
  2054.         UINT mask;
  2055.         int fmt;
  2056.         int cx;
  2057.         LPWSTR pszText;
  2058.         int cchTextMax;
  2059.         int iSubItem;
  2060.         int iImage;
  2061.         int iOrder;
  2062.     } LVCOLUMNW, * LPLVCOLUMNW;
  2063.  
  2064.     #ifdef UNICODE
  2065.     #define  LVCOLUMN               LVCOLUMNW
  2066.     #define  LPLVCOLUMN             LPLVCOLUMNW
  2067.     #else
  2068.     #define  LVCOLUMN               LVCOLUMNA
  2069.     #define  LPLVCOLUMN             LPLVCOLUMNA
  2070.     #endif
  2071.  
  2072.     #define LV_COLUMN               LVCOLUMN
  2073.     #define LV_COLUMNA              LVCOLUMNA
  2074.     #define LV_COLUMNW              LVCOLUMNW
  2075.     */
  2076.  
  2077.     #define LVCF_FMT                0x0001
  2078.     #define LVCF_WIDTH              0x0002
  2079.     #define LVCF_TEXT               0x0004
  2080.     #define LVCF_SUBITEM            0x0008
  2081.     #define LVCF_IMAGE              0x0010
  2082.     #define LVCF_ORDER              0x0020
  2083.  
  2084.     #define LVCFMT_LEFT             0x0000
  2085.     #define LVCFMT_RIGHT            0x0001
  2086.     #define LVCFMT_CENTER           0x0002
  2087.     #define LVCFMT_JUSTIFYMASK      0x0003
  2088.     #define LVCFMT_IMAGE            0x0800
  2089.     #define LVCFMT_BITMAP_ON_RIGHT  0x1000
  2090.     #define LVCFMT_COL_HAS_IMAGES   0x8000
  2091.  
  2092.  
  2093.     #define LVM_GETCOLUMNA          (LVM_FIRST + 25)
  2094.     #define LVM_GETCOLUMNW          (LVM_FIRST + 95)
  2095.     #ifdef UNICODE
  2096.     #define  LVM_GETCOLUMN          LVM_GETCOLUMNW
  2097.     #else
  2098.     #define  LVM_GETCOLUMN          LVM_GETCOLUMNA
  2099.     #endif
  2100.  
  2101.     /*
  2102.     //define ListView_GetColumn(hwnd, iCol, pcol) \
  2103.         (BOOL)SNDMSG((hwnd), LVM_GETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(LV_COLUMN FAR*)(pcol))
  2104.     */
  2105.  
  2106.  
  2107.     #define LVM_SETCOLUMNA          (LVM_FIRST + 26)
  2108.     #define LVM_SETCOLUMNW          (LVM_FIRST + 96)
  2109.     #ifdef UNICODE
  2110.     #define  LVM_SETCOLUMN          LVM_SETCOLUMNW
  2111.     #else
  2112.     #define  LVM_SETCOLUMN          LVM_SETCOLUMNA
  2113.     #endif
  2114.  
  2115.     /*
  2116.     //define ListView_SetColumn(hwnd, iCol, pcol) \
  2117.         (BOOL)SNDMSG((hwnd), LVM_SETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  2118.     */
  2119.  
  2120.  
  2121.     #define LVM_INSERTCOLUMNA       (LVM_FIRST + 27)
  2122.     #define LVM_INSERTCOLUMNW       (LVM_FIRST + 97)
  2123.     #ifdef UNICODE
  2124.     #   define  LVM_INSERTCOLUMN    LVM_INSERTCOLUMNW
  2125.     #else
  2126.     #   define  LVM_INSERTCOLUMN    LVM_INSERTCOLUMNA
  2127.     #endif
  2128.  
  2129.     /*
  2130.     //define ListView_InsertColumn(hwnd, iCol, pcol) \
  2131.         (int)SNDMSG((hwnd), LVM_INSERTCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol))
  2132.     */
  2133.  
  2134.  
  2135.     #define LVM_DELETECOLUMN        (LVM_FIRST + 28)
  2136.     /*
  2137.     //define ListView_DeleteColumn(hwnd, iCol) \
  2138.         (BOOL)SNDMSG((hwnd), LVM_DELETECOLUMN, (WPARAM)(int)(iCol), 0)
  2139.     */
  2140.  
  2141.  
  2142.     #define LVM_GETCOLUMNWIDTH      (LVM_FIRST + 29)
  2143.     /*
  2144.     //define ListView_GetColumnWidth(hwnd, iCol) \
  2145.         (int)SNDMSG((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0)
  2146.     */
  2147.  
  2148.  
  2149.     #define LVSCW_AUTOSIZE              -1
  2150.     #define LVSCW_AUTOSIZE_USEHEADER    -2
  2151.     #define LVM_SETCOLUMNWIDTH          (LVM_FIRST + 30)
  2152.  
  2153.     /*
  2154.     //define ListView_SetColumnWidth(hwnd, iCol, cx) \
  2155.         (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0))
  2156.     */
  2157.  
  2158.     #define LVM_GETHEADER               (LVM_FIRST + 31)
  2159.     /*
  2160.     //define ListView_GetHeader(hwnd)\
  2161.         (HWND)SNDMSG((hwnd), LVM_GETHEADER, 0, 0L)
  2162.     */
  2163.  
  2164.  
  2165.     #define LVM_CREATEDRAGIMAGE     (LVM_FIRST + 33)
  2166.     /*
  2167.     //define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \
  2168.         (HIMAGELIST)SNDMSG((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft))
  2169.     */
  2170.  
  2171.  
  2172.     #define LVM_GETVIEWRECT         (LVM_FIRST + 34)
  2173.     /*
  2174.     //define ListView_GetViewRect(hwnd, prc) \
  2175.         (BOOL)SNDMSG((hwnd), LVM_GETVIEWRECT, 0, (LPARAM)(RECT FAR*)(prc))
  2176.     */
  2177.  
  2178.  
  2179.     #define LVM_GETTEXTCOLOR        (LVM_FIRST + 35)
  2180.     /*
  2181.     //define ListView_GetTextColor(hwnd)  \
  2182.         (COLORREF)SNDMSG((hwnd), LVM_GETTEXTCOLOR, 0, 0L)
  2183.     */
  2184.  
  2185.  
  2186.     #define LVM_SETTEXTCOLOR        (LVM_FIRST + 36)
  2187.     /*
  2188.     //define ListView_SetTextColor(hwnd, clrText) \
  2189.         (BOOL)SNDMSG((hwnd), LVM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText))
  2190.     */
  2191.  
  2192.  
  2193.     #define LVM_GETTEXTBKCOLOR      (LVM_FIRST + 37)
  2194.     /*
  2195.     //define ListView_GetTextBkColor(hwnd)  \
  2196.         (COLORREF)SNDMSG((hwnd), LVM_GETTEXTBKCOLOR, 0, 0L)
  2197.     */
  2198.  
  2199.  
  2200.     #define LVM_SETTEXTBKCOLOR      (LVM_FIRST + 38)
  2201.     /*
  2202.     //define ListView_SetTextBkColor(hwnd, clrTextBk) \
  2203.         (BOOL)SNDMSG((hwnd), LVM_SETTEXTBKCOLOR, 0, (LPARAM)(COLORREF)(clrTextBk))
  2204.     */
  2205.  
  2206.  
  2207.     #define LVM_GETTOPINDEX         (LVM_FIRST + 39)
  2208.     /*
  2209.     //define ListView_GetTopIndex(hwndLV) \
  2210.         (int)SNDMSG((hwndLV), LVM_GETTOPINDEX, 0, 0)
  2211.     */
  2212.  
  2213.  
  2214.     #define LVM_GETCOUNTPERPAGE     (LVM_FIRST + 40)
  2215.     /*
  2216.     //define ListView_GetCountPerPage(hwndLV) \
  2217.         (int)SNDMSG((hwndLV), LVM_GETCOUNTPERPAGE, 0, 0)
  2218.     */
  2219.  
  2220.  
  2221.     #define LVM_GETORIGIN           (LVM_FIRST + 41)
  2222.     /*
  2223.     //define ListView_GetOrigin(hwndLV, ppt) \
  2224.         (BOOL)SNDMSG((hwndLV), LVM_GETORIGIN, (WPARAM)0, (LPARAM)(POINT FAR*)(ppt))
  2225.     */
  2226.  
  2227.  
  2228.     #define LVM_UPDATE              (LVM_FIRST + 42)
  2229.     /*
  2230.     //define ListView_Update(hwndLV, i) \
  2231.         (BOOL)SNDMSG((hwndLV), LVM_UPDATE, (WPARAM)i, 0L)
  2232.     */
  2233.  
  2234.  
  2235.     #define LVM_SETITEMSTATE        (LVM_FIRST + 43)
  2236.     /*
  2237.     //define ListView_SetItemState(hwndLV, i, data, mask) \
  2238.     { LV_ITEM _ms_lvi;\
  2239.       _ms_lvi.stateMask = mask;\
  2240.       _ms_lvi.state = data;\
  2241.       SNDMSG((hwndLV), LVM_SETITEMSTATE, (WPARAM)i, (LPARAM)(LV_ITEM *)&_ms_lvi);\
  2242.     }
  2243.     */
  2244.  
  2245.  
  2246.     #define LVM_GETITEMSTATE        (LVM_FIRST + 44)
  2247.     /*
  2248.     //define ListView_GetItemState(hwndLV, i, mask) \
  2249.        (UINT)SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, (LPARAM)mask)
  2250.     */
  2251.  
  2252.     /*
  2253.     //define ListView_GetCheckState(hwndLV, i) \
  2254.        ((((UINT)(SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, LVIS_STATEIMAGEMASK))) >> 12) -1)
  2255.     */
  2256.  
  2257.  
  2258.     #define LVM_GETITEMTEXTA        (LVM_FIRST + 45)
  2259.     #define LVM_GETITEMTEXTW        (LVM_FIRST + 115)
  2260.  
  2261.     #ifdef UNICODE
  2262.     #define  LVM_GETITEMTEXT        LVM_GETITEMTEXTW
  2263.     #else
  2264.     #define  LVM_GETITEMTEXT        LVM_GETITEMTEXTA
  2265.     #endif
  2266.  
  2267.     /*
  2268.     //define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \
  2269.     { LV_ITEM _ms_lvi;\
  2270.       _ms_lvi.iSubItem = iSubItem_;\
  2271.       _ms_lvi.cchTextMax = cchTextMax_;\
  2272.       _ms_lvi.pszText = pszText_;\
  2273.       SNDMSG((hwndLV), LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM *)&_ms_lvi);\
  2274.     }
  2275.     */
  2276.  
  2277.  
  2278.     #define LVM_SETITEMTEXTA        (LVM_FIRST + 46)
  2279.     #define LVM_SETITEMTEXTW        (LVM_FIRST + 116)
  2280.  
  2281.     #ifdef UNICODE
  2282.     #define  LVM_SETITEMTEXT        LVM_SETITEMTEXTW
  2283.     #else
  2284.     #define  LVM_SETITEMTEXT        LVM_SETITEMTEXTA
  2285.     #endif
  2286.  
  2287.     /*
  2288.     //define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_) \
  2289.     { LV_ITEM _ms_lvi;\
  2290.       _ms_lvi.iSubItem = iSubItem_;\
  2291.       _ms_lvi.pszText = pszText_;\
  2292.       SNDMSG((hwndLV), LVM_SETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM *)&_ms_lvi);\
  2293.     }
  2294.     */
  2295.  
  2296.     // these flags only apply to LVS_OWNERDATA listviews in report or list mode
  2297.     #define LVSICF_NOINVALIDATEALL  0x00000001
  2298.     #define LVSICF_NOSCROLL         0x00000002
  2299.  
  2300.     #define LVM_SETITEMCOUNT        (LVM_FIRST + 47)
  2301.     /*
  2302.     //define ListView_SetItemCount(hwndLV, cItems) \
  2303.       SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, 0)
  2304.     */
  2305.  
  2306.     /*
  2307.     //define ListView_SetItemCountEx(hwndLV, cItems, dwFlags) \
  2308.       SNDMSG((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, (LPARAM)dwFlags)
  2309.     */
  2310.  
  2311.     /*
  2312.     // typedef int (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
  2313.     typedef LONG PFNLVCOMPARE;
  2314.     */
  2315.  
  2316.  
  2317.     #define LVM_SORTITEMS           (LVM_FIRST + 48)
  2318.     /*
  2319.     //define ListView_SortItems(hwndLV, _pfnCompare, _lPrm) \
  2320.       (BOOL)SNDMSG((hwndLV), LVM_SORTITEMS, (WPARAM)(LPARAM)_lPrm, \
  2321.       (LPARAM)(PFNLVCOMPARE)_pfnCompare)
  2322.     */
  2323.  
  2324.  
  2325.     #define LVM_SETITEMPOSITION32   (LVM_FIRST + 49)
  2326.     /*
  2327.     //define ListView_SetItemPosition32(hwndLV, i, x, y) \
  2328.     { POINT ptNewPos = {x,y}; \
  2329.         SNDMSG((hwndLV), LVM_SETITEMPOSITION32, (WPARAM)(int)(i), (LPARAM)&ptNewPos); \
  2330.     }
  2331.     */
  2332.  
  2333.     #define LVM_GETSELECTEDCOUNT    (LVM_FIRST + 50)
  2334.     /*
  2335.     //define ListView_GetSelectedCount(hwndLV) \
  2336.         (UINT)SNDMSG((hwndLV), LVM_GETSELECTEDCOUNT, 0, 0L)
  2337.     */
  2338.  
  2339.  
  2340.     #define LVM_GETITEMSPACING      (LVM_FIRST + 51)
  2341.     /*
  2342.     //define ListView_GetItemSpacing(hwndLV, fSmall) \
  2343.             (DWORD)SNDMSG((hwndLV), LVM_GETITEMSPACING, fSmall, 0L)
  2344.     */
  2345.  
  2346.  
  2347.     #define LVM_GETISEARCHSTRINGA   (LVM_FIRST + 52)
  2348.     #define LVM_GETISEARCHSTRINGW   (LVM_FIRST + 117)
  2349.  
  2350.     #ifdef UNICODE
  2351.     #define LVM_GETISEARCHSTRING    LVM_GETISEARCHSTRINGW
  2352.     #else
  2353.     #define LVM_GETISEARCHSTRING    LVM_GETISEARCHSTRINGA
  2354.     #endif
  2355.  
  2356.     /*
  2357.     //define ListView_GetISearchString(hwndLV, lpsz) \
  2358.             (BOOL)SNDMSG((hwndLV), LVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
  2359.     */
  2360.  
  2361.     #define LVM_SETICONSPACING      (LVM_FIRST + 53)
  2362.     // -1 for cx and cy means we'll use the default (system settings)
  2363.     // 0 for cx or cy means use the current setting (allows you to change just one param)
  2364.     /*
  2365.     //define ListView_SetIconSpacing(hwndLV, cx, cy) \
  2366.             (DWORD)SNDMSG((hwndLV), LVM_SETICONSPACING, 0, MAKELONG(cx,cy))
  2367.     */
  2368.  
  2369.  
  2370.     #define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 54)
  2371.     /*
  2372.     //define ListView_SetExtendedListViewStyle(hwndLV, dw)\
  2373.             (DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw)
  2374.     */
  2375.  
  2376.     #define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 55)
  2377.     /*
  2378.     //define ListView_GetExtendedListViewStyle(hwndLV)\
  2379.             (DWORD)SNDMSG((hwndLV), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
  2380.     */
  2381.  
  2382.     #define LVS_EX_GRIDLINES        0x00000001
  2383.     #define LVS_EX_SUBITEMIMAGES    0x00000002
  2384.     #define LVS_EX_CHECKBOXES       0x00000004
  2385.     #define LVS_EX_TRACKSELECT      0x00000008
  2386.     #define LVS_EX_HEADERDRAGDROP   0x00000010
  2387.     #define LVS_EX_FULLROWSELECT    0x00000020 // applies to report mode only
  2388.     #define LVS_EX_ONECLICKACTIVATE 0x00000040
  2389.     #define LVS_EX_TWOCLICKACTIVATE 0x00000080
  2390.  
  2391.  
  2392.     #define LVM_GETSUBITEMRECT      (LVM_FIRST + 56)
  2393.     /*
  2394.     //define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \
  2395.             (BOOL)SNDMSG((hwnd), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
  2396.                     ((prc) ? ((((LPRECT)(prc))->top = iSubItem), (((LPRECT)(prc))->left = code), (LPARAM)(prc)) : (LPARAM)(LPRECT)NULL))
  2397.     */
  2398.  
  2399.     #define LVM_SUBITEMHITTEST      (LVM_FIRST + 57)
  2400.     /*
  2401.     //define ListView_SubItemHitTest(hwnd, plvhti) \
  2402.             (int)SNDMSG((hwnd), LVM_SUBITEMHITTEST, 0, (LPARAM)(LPLVHITTESTINFO)(plvhti))
  2403.     */
  2404.  
  2405.     #define LVM_SETCOLUMNORDERARRAY (LVM_FIRST + 58)
  2406.     /*
  2407.     //define ListView_SetColumnOrderArray(hwnd, iCount, pi) \
  2408.             (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
  2409.     */
  2410.  
  2411.     #define LVM_GETCOLUMNORDERARRAY (LVM_FIRST + 59)
  2412.     /*
  2413.     //define ListView_GetColumnOrderArray(hwnd, iCount, pi) \
  2414.             (BOOL)SNDMSG((hwnd), LVM_GETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi)
  2415.     */
  2416.  
  2417.     #define LVM_SETHOTITEM  (LVM_FIRST + 60)
  2418.     /*
  2419.     //define ListView_SetHotItem(hwnd, i) \
  2420.             (int)SNDMSG((hwnd), LVM_SETHOTITEM, (WPARAM)i, 0)
  2421.     */
  2422.  
  2423.     #define LVM_GETHOTITEM  (LVM_FIRST + 61)
  2424.     /*
  2425.     //define ListView_GetHotItem(hwnd) \
  2426.             (int)SNDMSG((hwnd), LVM_GETHOTITEM, 0, 0)
  2427.     */
  2428.  
  2429.     #define LVM_SETHOTCURSOR  (LVM_FIRST + 62)
  2430.     /*
  2431.     //define ListView_SetHotCursor(hwnd, hcur) \
  2432.             (HCURSOR)SNDMSG((hwnd), LVM_SETHOTCURSOR, 0, (LPARAM)hcur)
  2433.     */
  2434.  
  2435.     #define LVM_GETHOTCURSOR  (LVM_FIRST + 63)
  2436.     /*
  2437.     //define ListView_GetHotCursor(hwnd) \
  2438.             (HCURSOR)SNDMSG((hwnd), LVM_GETHOTCURSOR, 0, 0)
  2439.     */
  2440.  
  2441.     #define LVM_APPROXIMATEVIEWRECT (LVM_FIRST + 64)
  2442.     /*
  2443.     //define ListView_ApproximateViewRect(hwnd, iWidth, iHeight, iCount) \
  2444.             (DWORD)SNDMSG((hwnd), LVM_APPROXIMATEVIEWRECT, iCount, MAKELPARAM(iWidth, iHeight))
  2445.     */
  2446.  
  2447.     #define LVM_SETWORKAREA         (LVM_FIRST + 65)
  2448.     /*
  2449.     //define ListView_SetWorkArea(hwnd, prc) \
  2450.         (BOOL)SNDMSG((hwnd), LVM_SETWORKAREA, 0, (LPARAM)(RECT FAR*)(prc))
  2451.     */
  2452.  
  2453.     /*
  2454.     typedef struct NMLISTVIEW
  2455.     {
  2456.         NMHDR   hdr;
  2457.         int     iItem;
  2458.         int     iSubItem;
  2459.         UINT    uNewState;
  2460.         UINT    uOldState;
  2461.         UINT    uChanged;
  2462.         POINT   ptAction;
  2463.         LPARAM  lParam;
  2464.     } NMLISTVIEW, *LPNMLISTVIEW;
  2465.  
  2466.     #define LPNM_LISTVIEW   LPNMLISTVIEW
  2467.     #define NM_LISTVIEW     NMLISTVIEW
  2468.  
  2469.     typedef struct tagNMLVCUSTOMDRAW
  2470.     {
  2471.         NMCUSTOMDRAW nmcd;
  2472.         COLORREF clrText;
  2473.         COLORREF clrTextBk;
  2474.     } NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;
  2475.  
  2476.     typedef struct tagNMLVCACHEHINT
  2477.     {
  2478.         NMHDR   hdr;
  2479.         int     iFrom;
  2480.         int     iTo;
  2481.     } NMLVCACHEHINT, *LPNMLVCACHEHINT;
  2482.  
  2483.     #define LPNM_CACHEHINT  LPNMLVCACHEHINT
  2484.     #define PNM_CACHEHINT   LPNMLVCACHEHINT
  2485.     #define NM_CACHEHINT    NMLVCACHEHINT
  2486.  
  2487.     typedef struct tagNMLVFINDITEM
  2488.     {
  2489.         NMHDR   hdr;
  2490.         int     iStart;
  2491.         LVFINDINFO lvfi;
  2492.     } NMLVFINDITEM, *LPNMLVFINDITEM;
  2493.  
  2494.     #define PNM_FINDITEM    LPNMLVFINDITEM
  2495.     #define LPNM_FINDITEM   LPNMLVFINDITEM
  2496.     #define NM_FINDITEM     NMLVFINDITEM
  2497.  
  2498.     typedef struct tagNMLVODSTATECHANGE
  2499.     {
  2500.         NMHDR hdr;
  2501.         int iFrom;
  2502.         int iTo;
  2503.         UINT uNewState;
  2504.         UINT uOldState;
  2505.     } NMLVODSTATECHANGE, *LPNMLVODSTATECHANGE;
  2506.  
  2507.     #define PNM_ODSTATECHANGE   LPNMLVODSTATECHANGE
  2508.     #define LPNM_ODSTATECHANGE  LPNMLVODSTATECHANGE
  2509.     #define NM_ODSTATECHANGE    NMLVODSTATECHANGE
  2510.     */
  2511.  
  2512.     #define LVN_ITEMCHANGING        (LVN_FIRST-0)
  2513.     #define LVN_ITEMCHANGED         (LVN_FIRST-1)
  2514.     #define LVN_INSERTITEM          (LVN_FIRST-2)
  2515.     #define LVN_DELETEITEM          (LVN_FIRST-3)
  2516.     #define LVN_DELETEALLITEMS      (LVN_FIRST-4)
  2517.     #define LVN_BEGINLABELEDITA     (LVN_FIRST-5)
  2518.     #define LVN_BEGINLABELEDITW     (LVN_FIRST-75)
  2519.     #define LVN_ENDLABELEDITA       (LVN_FIRST-6)
  2520.     #define LVN_ENDLABELEDITW       (LVN_FIRST-76)
  2521.     #define LVN_COLUMNCLICK         (LVN_FIRST-8)
  2522.     #define LVN_BEGINDRAG           (LVN_FIRST-9)
  2523.     #define LVN_BEGINRDRAG          (LVN_FIRST-11)
  2524.  
  2525.     #define LVN_ODCACHEHINT         (LVN_FIRST-13)
  2526.     #define LVN_ODFINDITEMA         (LVN_FIRST-52)
  2527.     #define LVN_ODFINDITEMW         (LVN_FIRST-79)
  2528.  
  2529.     #define LVN_ITEMACTIVATE        (LVN_FIRST-14)
  2530.     #define LVN_ODSTATECHANGED      (LVN_FIRST-15)
  2531.  
  2532.     #ifdef UNICODE
  2533.     #define LVN_ODFINDITEM          LVN_ODFINDITEMW
  2534.     #else
  2535.     #define LVN_ODFINDITEM          LVN_ODFINDITEMA
  2536.     #endif
  2537.  
  2538.  
  2539.  
  2540.     #define LVN_GETDISPINFOA        (LVN_FIRST-50)
  2541.     #define LVN_GETDISPINFOW        (LVN_FIRST-77)
  2542.     #define LVN_SETDISPINFOA        (LVN_FIRST-51)
  2543.     #define LVN_SETDISPINFOW        (LVN_FIRST-78)
  2544.  
  2545.     #ifdef UNICODE
  2546.     #define LVN_BEGINLABELEDIT      LVN_BEGINLABELEDITW
  2547.     #define LVN_ENDLABELEDIT        LVN_ENDLABELEDITW
  2548.     #define LVN_GETDISPINFO         LVN_GETDISPINFOW
  2549.     #define LVN_SETDISPINFO         LVN_SETDISPINFOW
  2550.     #else
  2551.     #define LVN_BEGINLABELEDIT      LVN_BEGINLABELEDITA
  2552.     #define LVN_ENDLABELEDIT        LVN_ENDLABELEDITA
  2553.     #define LVN_GETDISPINFO         LVN_GETDISPINFOA
  2554.     #define LVN_SETDISPINFO         LVN_SETDISPINFOA
  2555.     #endif
  2556.  
  2557.  
  2558.  
  2559.  
  2560.     #define LVIF_DI_SETITEM         0x1000
  2561.  
  2562.     /*
  2563.     typedef struct tagLVDISPINFO {
  2564.         NMHDR hdr;
  2565.         LVITEMA item;
  2566.     } NMLVDISPINFOA, *LPNMLVDISPINFOA;
  2567.  
  2568.     typedef struct tagLVDISPINFOW {
  2569.         NMHDR hdr;
  2570.         LVITEMW item;
  2571.     } NMLVDISPINFOW, * LPNMLVDISPINFOW;
  2572.  
  2573.     #define LV_DISPINFOA    NMLVDISPINFOA
  2574.     #define LV_DISPINFOW    NMLVDISPINFOW
  2575.     #define LV_DISPINFO     NMLVDISPINFO
  2576.  
  2577.     #ifdef UNICODE
  2578.     #define  NMLVDISPINFO           NMLVDISPINFOW
  2579.     #else
  2580.     #define  NMLVDISPINFO           NMLVDISPINFOA
  2581.     #endif
  2582.     */
  2583.  
  2584.     #define LVN_KEYDOWN             (LVN_FIRST-55)
  2585.  
  2586.     /*
  2587.     typedef struct tagLVKEYDOWN
  2588.     {
  2589.         NMHDR hdr;
  2590.         WORD wVKey;
  2591.         UINT flags;
  2592.     } NMLVKEYDOWN, *LPNMLVKEYDOWN;
  2593.     #define LV_KEYDOWN              NMLVKEYDOWN
  2594.     */
  2595.  
  2596.     #define LVN_MARQUEEBEGIN        (LVN_FIRST-56)
  2597.  
  2598.     #endif
  2599.  
  2600.     //====== TREEVIEW CONTROL ==============
  2601.  
  2602.     #define NOTREEVIEW
  2603.     #ifndef NOTREEVIEW
  2604.  
  2605.     #define TVS_HASBUTTONS          0x0001
  2606.     #define TVS_HASLINES            0x0002
  2607.     #define TVS_LINESATROOT         0x0004
  2608.     #define TVS_EDITLABELS          0x0008
  2609.     #define TVS_DISABLEDRAGDROP     0x0010
  2610.     #define TVS_SHOWSELALWAYS       0x0020
  2611.     #define TVS_RTLREADING          0x0040
  2612.  
  2613.     #define TVS_NOTOOLTIPS          0x0080
  2614.     #define TVS_CHECKBOXES          0x0100
  2615.     #define TVS_TRACKSELECT         0x0200
  2616.  
  2617.     #define TVS_SHAREDIMAGELISTS    0x0000
  2618.     #define TVS_PRIVATEIMAGELISTS   0x0400
  2619.  
  2620.     typedef struct _TREEITEM FAR* HTREEITEM;
  2621.  
  2622.     #define TVIF_TEXT               0x0001
  2623.     #define TVIF_IMAGE              0x0002
  2624.     #define TVIF_PARAM              0x0004
  2625.     #define TVIF_STATE              0x0008
  2626.     #define TVIF_HANDLE             0x0010
  2627.     #define TVIF_SELECTEDIMAGE      0x0020
  2628.     #define TVIF_CHILDREN           0x0040
  2629.  
  2630.     #define TVIS_SELECTED           0x0002
  2631.     #define TVIS_CUT                0x0004
  2632.     #define TVIS_DROPHILITED        0x0008
  2633.     #define TVIS_BOLD               0x0010
  2634.     #define TVIS_EXPANDED           0x0020
  2635.     #define TVIS_EXPANDEDONCE       0x0040
  2636.     #define TVIS_EXPANDPARTIAL      0x0080
  2637.  
  2638.     #define TVIS_OVERLAYMASK        0x0F00
  2639.     #define TVIS_STATEIMAGEMASK     0xF000
  2640.     #define TVIS_USERMASK           0xF000
  2641.  
  2642.  
  2643.     #define I_CHILDRENCALLBACK  (-1)
  2644.  
  2645.     typedef struct tagTVITEMA {
  2646.         UINT      mask;
  2647.         HTREEITEM hItem;
  2648.         UINT      state;
  2649.         UINT      stateMask;
  2650.         LPSTR     pszText;
  2651.         int       cchTextMax;
  2652.         int       iImage;
  2653.         int       iSelectedImage;
  2654.         int       cChildren;
  2655.         LPARAM    lParam;
  2656.     } TVITEMA, *LPTVITEMA;
  2657.  
  2658.     typedef struct tagTVITEMW {
  2659.         UINT      mask;
  2660.         HTREEITEM hItem;
  2661.         UINT      state;
  2662.         UINT      stateMask;
  2663.         LPWSTR    pszText;
  2664.         int       cchTextMax;
  2665.         int       iImage;
  2666.         int       iSelectedImage;
  2667.         int       cChildren;
  2668.         LPARAM    lParam;
  2669.     } TVITEMW, *LPTVITEMW;
  2670.  
  2671.     #define LPTV_ITEMW              LPTVITEMW
  2672.     #define LPTV_ITEMA              LPTVITEMA
  2673.     #define LPTV_ITEM               LPTVITEM
  2674.     #define TV_ITEMW                TVITEMW
  2675.     #define TV_ITEMA                TVITEMA
  2676.     #define TV_ITEM                 TVITEM
  2677.  
  2678.     #ifdef UNICODE
  2679.     #define  TVITEM                 TVITEMW
  2680.     #define  LPTVITEM               LPTVITEMW
  2681.     #else
  2682.     #define  TVITEM                 TVITEMA
  2683.     #define  LPTVITEM               LPTVITEMA
  2684.     #endif
  2685.  
  2686.  
  2687.     #define TVI_ROOT                ((HTREEITEM)0xFFFF0000)
  2688.     #define TVI_FIRST               ((HTREEITEM)0xFFFF0001)
  2689.     #define TVI_LAST                ((HTREEITEM)0xFFFF0002)
  2690.     #define TVI_SORT                ((HTREEITEM)0xFFFF0003)
  2691.  
  2692.     typedef struct tagTVINSERTSTRUCTA {
  2693.         HTREEITEM hParent;
  2694.         HTREEITEM hInsertAfter;
  2695.         TV_ITEMA item;
  2696.     } TVINSERTSTRUCTA, *LPTVINSERTSTRUCTA;
  2697.  
  2698.     typedef struct tagTVINSERTSTRUCTW {
  2699.         HTREEITEM hParent;
  2700.         HTREEITEM hInsertAfter;
  2701.         TV_ITEMW item;
  2702.     } TVINSERTSTRUCTW, *LPTVINSERTSTRUCTW;
  2703.  
  2704.     #define LPTV_INSERTSTRUCTA      LPTVINSERTSTRUCTA
  2705.     #define LPTV_INSERTSTRUCTW      LPTVINSERTSTRUCTW
  2706.     #define LPTV_INSERTSTRUCT       LPTVINSERTSTRUCT
  2707.     #define TV_INSERTSTRUCTA        TVINSERTSTRUCTA
  2708.     #define TV_INSERTSTRUCTW        TVINSERTSTRUCTW
  2709.     #define TV_INSERTSTRUCT         TVINSERTSTRUCT
  2710.  
  2711.     #ifdef UNICODE
  2712.     #define  TVINSERTSTRUCT         TVINSERTSTRUCTW
  2713.     #define  LPTVINSERTSTRUCT       LPTVINSERTSTRUCTW
  2714.     #else
  2715.     #define  TVINSERTSTRUCT         TVINSERTSTRUCTA
  2716.     #define  LPTVINSERTSTRUCT       LPTVINSERTSTRUCTA
  2717.     #endif
  2718.  
  2719.     #define TVM_INSERTITEMA         (TV_FIRST + 0)
  2720.     #define TVM_INSERTITEMW         (TV_FIRST + 50)
  2721.     #ifdef UNICODE
  2722.     #define  TVM_INSERTITEM         TVM_INSERTITEMW
  2723.     #else
  2724.     #define  TVM_INSERTITEM         TVM_INSERTITEMA
  2725.     #endif
  2726.  
  2727.     #define TreeView_InsertItem(hwnd, lpis) \
  2728.         (HTREEITEM)SNDMSG((hwnd), TVM_INSERTITEM, 0, (LPARAM)(LPTV_INSERTSTRUCT)(lpis))
  2729.  
  2730.  
  2731.     #define TVM_DELETEITEM          (TV_FIRST + 1)
  2732.     #define TreeView_DeleteItem(hwnd, hitem) \
  2733.         (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hitem))
  2734.  
  2735.  
  2736.     #define TreeView_DeleteAllItems(hwnd) \
  2737.         (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT)
  2738.  
  2739.  
  2740.     #define TVM_EXPAND              (TV_FIRST + 2)
  2741.     #define TreeView_Expand(hwnd, hitem, code) \
  2742.         (BOOL)SNDMSG((hwnd), TVM_EXPAND, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  2743.  
  2744.  
  2745.     #define TVE_COLLAPSE            0x0001
  2746.     #define TVE_EXPAND              0x0002
  2747.     #define TVE_TOGGLE              0x0003
  2748.     #define TVE_EXPANDPARTIAL       0x4000
  2749.     #define TVE_COLLAPSERESET       0x8000
  2750.  
  2751.  
  2752.     #define TVM_GETITEMRECT         (TV_FIRST + 4)
  2753.     #define TreeView_GetItemRect(hwnd, hitem, prc, code) \
  2754.         (*(HTREEITEM *)prc = (hitem), (BOOL)SNDMSG((hwnd), TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT FAR*)(prc)))
  2755.  
  2756.  
  2757.     #define TVM_GETCOUNT            (TV_FIRST + 5)
  2758.     #define TreeView_GetCount(hwnd) \
  2759.         (UINT)SNDMSG((hwnd), TVM_GETCOUNT, 0, 0)
  2760.  
  2761.  
  2762.     #define TVM_GETINDENT           (TV_FIRST + 6)
  2763.     #define TreeView_GetIndent(hwnd) \
  2764.         (UINT)SNDMSG((hwnd), TVM_GETINDENT, 0, 0)
  2765.  
  2766.  
  2767.     #define TVM_SETINDENT           (TV_FIRST + 7)
  2768.     #define TreeView_SetIndent(hwnd, indent) \
  2769.         (BOOL)SNDMSG((hwnd), TVM_SETINDENT, (WPARAM)indent, 0)
  2770.  
  2771.  
  2772.     #define TVM_GETIMAGELIST        (TV_FIRST + 8)
  2773.     #define TreeView_GetImageList(hwnd, iImage) \
  2774.         (HIMAGELIST)SNDMSG((hwnd), TVM_GETIMAGELIST, iImage, 0)
  2775.  
  2776.  
  2777.     #define TVSIL_NORMAL            0
  2778.     #define TVSIL_STATE             2
  2779.  
  2780.  
  2781.     #define TVM_SETIMAGELIST        (TV_FIRST + 9)
  2782.     #define TreeView_SetImageList(hwnd, himl, iImage) \
  2783.         (HIMAGELIST)SNDMSG((hwnd), TVM_SETIMAGELIST, iImage, (LPARAM)(UINT)(HIMAGELIST)(himl))
  2784.  
  2785.  
  2786.     #define TVM_GETNEXTITEM         (TV_FIRST + 10)
  2787.     #define TreeView_GetNextItem(hwnd, hitem, code) \
  2788.         (HTREEITEM)SNDMSG((hwnd), TVM_GETNEXTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  2789.  
  2790.  
  2791.     #define TVGN_ROOT               0x0000
  2792.     #define TVGN_NEXT               0x0001
  2793.     #define TVGN_PREVIOUS           0x0002
  2794.     #define TVGN_PARENT             0x0003
  2795.     #define TVGN_CHILD              0x0004
  2796.     #define TVGN_FIRSTVISIBLE       0x0005
  2797.     #define TVGN_NEXTVISIBLE        0x0006
  2798.     #define TVGN_PREVIOUSVISIBLE    0x0007
  2799.     #define TVGN_DROPHILITE         0x0008
  2800.     #define TVGN_CARET              0x0009
  2801.  
  2802.     #define TreeView_GetChild(hwnd, hitem)          TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD)
  2803.     #define TreeView_GetNextSibling(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT)
  2804.     #define TreeView_GetPrevSibling(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS)
  2805.     #define TreeView_GetParent(hwnd, hitem)         TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT)
  2806.     #define TreeView_GetFirstVisible(hwnd)          TreeView_GetNextItem(hwnd, NULL,  TVGN_FIRSTVISIBLE)
  2807.     #define TreeView_GetNextVisible(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE)
  2808.     #define TreeView_GetPrevVisible(hwnd, hitem)    TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE)
  2809.     #define TreeView_GetSelection(hwnd)             TreeView_GetNextItem(hwnd, NULL,  TVGN_CARET)
  2810.     #define TreeView_GetDropHilight(hwnd)           TreeView_GetNextItem(hwnd, NULL,  TVGN_DROPHILITE)
  2811.     #define TreeView_GetRoot(hwnd)                  TreeView_GetNextItem(hwnd, NULL,  TVGN_ROOT)
  2812.  
  2813.  
  2814.     #define TVM_SELECTITEM          (TV_FIRST + 11)
  2815.     #define TreeView_Select(hwnd, hitem, code) \
  2816.         (HTREEITEM)SNDMSG((hwnd), TVM_SELECTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem))
  2817.  
  2818.  
  2819.     #define TreeView_SelectItem(hwnd, hitem)            TreeView_Select(hwnd, hitem, TVGN_CARET)
  2820.     #define TreeView_SelectDropTarget(hwnd, hitem)      TreeView_Select(hwnd, hitem, TVGN_DROPHILITE)
  2821.     #define TreeView_SelectSetFirstVisible(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE)
  2822.  
  2823.  
  2824.     #define TVM_GETITEMA            (TV_FIRST + 12)
  2825.     #define TVM_GETITEMW            (TV_FIRST + 62)
  2826.  
  2827.     #ifdef UNICODE
  2828.     #define  TVM_GETITEM            TVM_GETITEMW
  2829.     #else
  2830.     #define  TVM_GETITEM            TVM_GETITEMA
  2831.     #endif
  2832.  
  2833.     #define TreeView_GetItem(hwnd, pitem) \
  2834.         (BOOL)SNDMSG((hwnd), TVM_GETITEM, 0, (LPARAM)(TV_ITEM FAR*)(pitem))
  2835.  
  2836.  
  2837.     #define TVM_SETITEMA            (TV_FIRST + 13)
  2838.     #define TVM_SETITEMW            (TV_FIRST + 63)
  2839.  
  2840.     #ifdef UNICODE
  2841.     #define  TVM_SETITEM            TVM_SETITEMW
  2842.     #else
  2843.     #define  TVM_SETITEM            TVM_SETITEMA
  2844.     #endif
  2845.  
  2846.     #define TreeView_SetItem(hwnd, pitem) \
  2847.         (BOOL)SNDMSG((hwnd), TVM_SETITEM, 0, (LPARAM)(const TV_ITEM FAR*)(pitem))
  2848.  
  2849.  
  2850.     #define TVM_EDITLABELA          (TV_FIRST + 14)
  2851.     #define TVM_EDITLABELW          (TV_FIRST + 65)
  2852.     #ifdef UNICODE
  2853.     #define TVM_EDITLABEL           TVM_EDITLABELW
  2854.     #else
  2855.     #define TVM_EDITLABEL           TVM_EDITLABELA
  2856.     #endif
  2857.  
  2858.     #define TreeView_EditLabel(hwnd, hitem) \
  2859.         (HWND)SNDMSG((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem))
  2860.  
  2861.  
  2862.     #define TVM_GETEDITCONTROL      (TV_FIRST + 15)
  2863.     #define TreeView_GetEditControl(hwnd) \
  2864.         (HWND)SNDMSG((hwnd), TVM_GETEDITCONTROL, 0, 0)
  2865.  
  2866.  
  2867.     #define TVM_GETVISIBLECOUNT     (TV_FIRST + 16)
  2868.     #define TreeView_GetVisibleCount(hwnd) \
  2869.         (UINT)SNDMSG((hwnd), TVM_GETVISIBLECOUNT, 0, 0)
  2870.  
  2871.  
  2872.     #define TVM_HITTEST             (TV_FIRST + 17)
  2873.     #define TreeView_HitTest(hwnd, lpht) \
  2874.         (HTREEITEM)SNDMSG((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht))
  2875.  
  2876.  
  2877.     typedef struct tagTVHITTESTINFO {
  2878.         POINT       pt;
  2879.         UINT        flags;
  2880.         HTREEITEM   hItem;
  2881.     } TVHITTESTINFO, *LPTVHITTESTINFO;
  2882.     #define LPTV_HITTESTINFO        LPTVHITTESTINFO
  2883.     #define TV_HITTESTINFO  TVHITTESTINFO
  2884.  
  2885.     #define TVHT_NOWHERE            0x0001
  2886.     #define TVHT_ONITEMICON         0x0002
  2887.     #define TVHT_ONITEMLABEL        0x0004
  2888.     #define TVHT_ONITEM             (TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON)
  2889.     #define TVHT_ONITEMINDENT       0x0008
  2890.     #define TVHT_ONITEMBUTTON       0x0010
  2891.     #define TVHT_ONITEMRIGHT        0x0020
  2892.     #define TVHT_ONITEMSTATEICON    0x0040
  2893.  
  2894.     #define TVHT_ABOVE              0x0100
  2895.     #define TVHT_BELOW              0x0200
  2896.     #define TVHT_TORIGHT            0x0400
  2897.     #define TVHT_TOLEFT             0x0800
  2898.  
  2899.  
  2900.     #define TVM_CREATEDRAGIMAGE     (TV_FIRST + 18)
  2901.     #define TreeView_CreateDragImage(hwnd, hitem) \
  2902.         (HIMAGELIST)SNDMSG((hwnd), TVM_CREATEDRAGIMAGE, 0, (LPARAM)(HTREEITEM)(hitem))
  2903.  
  2904.  
  2905.     #define TVM_SORTCHILDREN        (TV_FIRST + 19)
  2906.     #define TreeView_SortChildren(hwnd, hitem, recurse) \
  2907.         (BOOL)SNDMSG((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse, (LPARAM)(HTREEITEM)(hitem))
  2908.  
  2909.  
  2910.     #define TVM_ENSUREVISIBLE       (TV_FIRST + 20)
  2911.     #define TreeView_EnsureVisible(hwnd, hitem) \
  2912.         (BOOL)SNDMSG((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(HTREEITEM)(hitem))
  2913.  
  2914.  
  2915.     #define TVM_SORTCHILDRENCB      (TV_FIRST + 21)
  2916.     #define TreeView_SortChildrenCB(hwnd, psort, recurse) \
  2917.         (BOOL)SNDMSG((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \
  2918.         (LPARAM)(LPTV_SORTCB)(psort))
  2919.  
  2920.  
  2921.     #define TVM_ENDEDITLABELNOW     (TV_FIRST + 22)
  2922.     #define TreeView_EndEditLabelNow(hwnd, fCancel) \
  2923.         (BOOL)SNDMSG((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0)
  2924.  
  2925.  
  2926.     #define TVM_GETISEARCHSTRINGA   (TV_FIRST + 23)
  2927.     #define TVM_GETISEARCHSTRINGW   (TV_FIRST + 64)
  2928.  
  2929.     #ifdef UNICODE
  2930.     #define TVM_GETISEARCHSTRING     TVM_GETISEARCHSTRINGW
  2931.     #else
  2932.     #define TVM_GETISEARCHSTRING     TVM_GETISEARCHSTRINGA
  2933.     #endif
  2934.  
  2935.     #define TVM_SETTOOLTIPS         (TV_FIRST + 24)
  2936.     #define TVM_GETTOOLTIPS         (TV_FIRST + 25)
  2937.  
  2938.     #define TreeView_GetISearchString(hwndTV, lpsz) \
  2939.             (BOOL)SNDMSG((hwndTV), TVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz)
  2940.  
  2941.  
  2942.     typedef int (CALLBACK *PFNTVCOMPARE)(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
  2943.     typedef struct tagTVSORTCB
  2944.     {
  2945.             HTREEITEM       hParent;
  2946.             PFNTVCOMPARE    lpfnCompare;
  2947.             LPARAM          lParam;
  2948.     } TVSORTCB, *LPTVSORTCB;
  2949.     #define LPTV_SORTCB             LPTVSORTCB
  2950.     #define TV_SORTCB               TVSORTCB
  2951.  
  2952.  
  2953.     typedef struct tagNMTREEVIEWA {
  2954.         NMHDR       hdr;
  2955.         UINT        action;
  2956.         TVITEMA    itemOld;
  2957.         TVITEMA    itemNew;
  2958.         POINT       ptDrag;
  2959.     } NMTREEVIEWA, *LPNMTREEVIEWA;
  2960.  
  2961.  
  2962.     typedef struct tagNMTREEVIEWW {
  2963.         NMHDR       hdr;
  2964.         UINT        action;
  2965.         TVITEMW    itemOld;
  2966.         TVITEMW    itemNew;
  2967.         POINT       ptDrag;
  2968.     } NMTREEVIEWW, *LPNMTREEVIEWW;
  2969.  
  2970.     #define LPNM_TREEVIEWA          LPNMTREEVIEWA
  2971.     #define LPNM_TREEVIEWW          LPNMTREEVIEWW
  2972.     #define LPNM_TREEVIEW           LPNMTREEVIEW
  2973.     #define NM_TREEVIEWW            NMTREEVIEWW
  2974.     #define NM_TREEVIEWA            NMTREEVIEWA
  2975.     #define NM_TREEVIEW             NMTREEVIEW
  2976.  
  2977.     #ifdef UNICODE
  2978.     #define  NMTREEVIEW             NMTREEVIEWW
  2979.     #define  LPNMTREEVIEW           LPNMTREEVIEWW
  2980.     #else
  2981.     #define  NMTREEVIEW             NMTREEVIEWA
  2982.     #define  LPNMTREEVIEW           LPNMTREEVIEWA
  2983.     #endif
  2984.  
  2985.  
  2986.     #define TVN_SELCHANGINGA        (TVN_FIRST-1)
  2987.     #define TVN_SELCHANGINGW        (TVN_FIRST-50)
  2988.     #define TVN_SELCHANGEDA         (TVN_FIRST-2)
  2989.     #define TVN_SELCHANGEDW         (TVN_FIRST-51)
  2990.  
  2991.     #define TVC_UNKNOWN             0x0000
  2992.     #define TVC_BYMOUSE             0x0001
  2993.     #define TVC_BYKEYBOARD          0x0002
  2994.  
  2995.     #define TVN_GETDISPINFOA        (TVN_FIRST-3)
  2996.     #define TVN_GETDISPINFOW        (TVN_FIRST-52)
  2997.     #define TVN_SETDISPINFOA        (TVN_FIRST-4)
  2998.     #define TVN_SETDISPINFOW        (TVN_FIRST-53)
  2999.  
  3000.     #define TVIF_DI_SETITEM         0x1000
  3001.  
  3002.     typedef struct tagTVDISPINFOA {
  3003.         NMHDR hdr;
  3004.         TVITEMA item;
  3005.     } NMTVDISPINFOA, *LPNMTVDISPINFOA;
  3006.  
  3007.     typedef struct tagTVDISPINFOW {
  3008.         NMHDR hdr;
  3009.         TVITEMW item;
  3010.     } NMTVDISPINFOW, *LPNMTVDISPINFOW;
  3011.  
  3012.     #define TV_DISPINFOA            NMTVDISPINFOA
  3013.     #define TV_DISPINFOW            NMTVDISPINFOW
  3014.     #define TV_DISPINFO             NMTVDISPINFO
  3015.  
  3016.     #ifdef UNICODE
  3017.     #define NMTVDISPINFO            NMTVDISPINFOW
  3018.     #define LPNMTVDISPINFO          LPNMTVDISPINFOW
  3019.     #else
  3020.     #define NMTVDISPINFO            NMTVDISPINFOA
  3021.     #define LPNMTVDISPINFO          LPNMTVDISPINFOA
  3022.     #endif
  3023.  
  3024.     #define TVN_ITEMEXPANDINGA      (TVN_FIRST-5)
  3025.     #define TVN_ITEMEXPANDINGW      (TVN_FIRST-54)
  3026.     #define TVN_ITEMEXPANDEDA       (TVN_FIRST-6)
  3027.     #define TVN_ITEMEXPANDEDW       (TVN_FIRST-55)
  3028.     #define TVN_BEGINDRAGA          (TVN_FIRST-7)
  3029.     #define TVN_BEGINDRAGW          (TVN_FIRST-56)
  3030.     #define TVN_BEGINRDRAGA         (TVN_FIRST-8)
  3031.     #define TVN_BEGINRDRAGW         (TVN_FIRST-57)
  3032.     #define TVN_DELETEITEMA         (TVN_FIRST-9)
  3033.     #define TVN_DELETEITEMW         (TVN_FIRST-58)
  3034.     #define TVN_BEGINLABELEDITA     (TVN_FIRST-10)
  3035.     #define TVN_BEGINLABELEDITW     (TVN_FIRST-59)
  3036.     #define TVN_ENDLABELEDITA       (TVN_FIRST-11)
  3037.     #define TVN_ENDLABELEDITW       (TVN_FIRST-60)
  3038.     #define TVN_KEYDOWN             (TVN_FIRST-12)
  3039.  
  3040.     typedef struct tagTVKEYDOWN {
  3041.         NMHDR hdr;
  3042.         WORD wVKey;
  3043.         UINT flags;
  3044.     } NMTVKEYDOWN, *LPNMTVKEYDOWN;
  3045.  
  3046.     #define TV_KEYDOWN      NMTVKEYDOWN
  3047.  
  3048.     #ifdef UNICODE
  3049.     #define TVN_SELCHANGING         TVN_SELCHANGINGW
  3050.     #define TVN_SELCHANGED          TVN_SELCHANGEDW
  3051.     #define TVN_GETDISPINFO         TVN_GETDISPINFOW
  3052.     #define TVN_SETDISPINFO         TVN_SETDISPINFOW
  3053.     #define TVN_ITEMEXPANDING       TVN_ITEMEXPANDINGW
  3054.     #define TVN_ITEMEXPANDED        TVN_ITEMEXPANDEDW
  3055.     #define TVN_BEGINDRAG           TVN_BEGINDRAGW
  3056.     #define TVN_BEGINRDRAG          TVN_BEGINRDRAGW
  3057.     #define TVN_DELETEITEM          TVN_DELETEITEMW
  3058.     #define TVN_BEGINLABELEDIT      TVN_BEGINLABELEDITW
  3059.     #define TVN_ENDLABELEDIT        TVN_ENDLABELEDITW
  3060.     #else
  3061.     #define TVN_SELCHANGING         TVN_SELCHANGINGA
  3062.     #define TVN_SELCHANGED          TVN_SELCHANGEDA
  3063.     #define TVN_GETDISPINFO         TVN_GETDISPINFOA
  3064.     #define TVN_SETDISPINFO         TVN_SETDISPINFOA
  3065.     #define TVN_ITEMEXPANDING       TVN_ITEMEXPANDINGA
  3066.     #define TVN_ITEMEXPANDED        TVN_ITEMEXPANDEDA
  3067.     #define TVN_BEGINDRAG           TVN_BEGINDRAGA
  3068.     #define TVN_BEGINRDRAG          TVN_BEGINRDRAGA
  3069.     #define TVN_DELETEITEM          TVN_DELETEITEMA
  3070.     #define TVN_BEGINLABELEDIT      TVN_BEGINLABELEDITA
  3071.     #define TVN_ENDLABELEDIT        TVN_ENDLABELEDITA
  3072.     #endif
  3073.  
  3074.     typedef struct tagNMTVCUSTOMDRAW
  3075.     {
  3076.         NMCUSTOMDRAW nmcd;
  3077.         COLORREF     clrText;
  3078.         COLORREF     clrTextBk;
  3079.     } NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW;
  3080.  
  3081.     #endif
  3082.  
  3083.  
  3084.     ////////////////////  ComboBoxEx ////////////////////////////////
  3085.  
  3086.     #if 0
  3087.  
  3088.     #define CBEIF_TEXT              0x00000001
  3089.     #define CBEIF_IMAGE             0x00000002
  3090.     #define CBEIF_SELECTEDIMAGE     0x00000004
  3091.     #define CBEIF_OVERLAY           0x00000008
  3092.     #define CBEIF_INDENT            0x00000010
  3093.     #define CBEIF_LPARAM            0x00000020
  3094.  
  3095.     #define CBEIF_DI_SETITEM        0x10000000
  3096.  
  3097.     typedef struct tagCOMBOBOXEXITEMA
  3098.     {
  3099.         UINT mask;
  3100.         int iItem;
  3101.         LPSTR pszText;
  3102.         int cchTextMax;
  3103.         int iImage;
  3104.         int iSelectedImage;
  3105.         int iOverlay;
  3106.         int iIndent;
  3107.         LPARAM lParam;
  3108.     } COMBOBOXEXITEMA, *PCOMBOBOXEXITEMA;
  3109.     typedef COMBOBOXEXITEMA CONST *PCCOMBOEXITEMA;
  3110.  
  3111.  
  3112.     typedef struct tagCOMBOBOXEXITEMW
  3113.     {
  3114.         UINT mask;
  3115.         int iItem;
  3116.         LPWSTR pszText;
  3117.         int cchTextMax;
  3118.         int iImage;
  3119.         int iSelectedImage;
  3120.         int iOverlay;
  3121.         int iIndent;
  3122.         LPARAM lParam;
  3123.     } COMBOBOXEXITEMW, *PCOMBOBOXEXITEMW;
  3124.     typedef COMBOBOXEXITEMW CONST *PCCOMBOEXITEMW;
  3125.  
  3126.     #ifdef UNICODE
  3127.     #define COMBOBOXEXITEM            COMBOBOXEXITEMW
  3128.     #define PCOMBOBOXEXITEM           PCOMBOBOXEXITEMW
  3129.     #define PCCOMBOBOXEXITEM          PCCOMBOBOXEXITEMW
  3130.     #else
  3131.     #define COMBOBOXEXITEM            COMBOBOXEXITEMA
  3132.     #define PCOMBOBOXEXITEM           PCOMBOBOXEXITEMA
  3133.     #define PCCOMBOBOXEXITEM          PCCOMBOBOXEXITEMA
  3134.     #endif
  3135.  
  3136.     #define CBEM_INSERTITEMA        (WM_USER + 1)
  3137.     #define CBEM_SETIMAGELIST       (WM_USER + 2)
  3138.     #define CBEM_GETIMAGELIST       (WM_USER + 3)
  3139.     #define CBEM_GETITEMA           (WM_USER + 4)
  3140.     #define CBEM_SETITEMA           (WM_USER + 5)
  3141.     #define CBEM_DELETEITEM         CB_DELETESTRING
  3142.     #define CBEM_GETCOMBOCONTROL    (WM_USER + 6)
  3143.     #define CBEM_GETEDITCONTROL     (WM_USER + 7)
  3144.     #define CBEM_SETEXSTYLE         (WM_USER + 8)
  3145.     #define CBEM_GETEXSTYLE         (WM_USER + 9)
  3146.     #define CBEM_HASEDITCHANGED     (WM_USER + 10)
  3147.     #define CBEM_INSERTITEMW        (WM_USER + 11)
  3148.     #define CBEM_SETITEMW           (WM_USER + 12)
  3149.     #define CBEM_GETITEMW           (WM_USER + 13)
  3150.  
  3151.     #ifdef UNICODE
  3152.     #define CBEM_INSERTITEM         CBEM_INSERTITEMW
  3153.     #define CBEM_SETITEM            CBEM_SETITEMW
  3154.     #define CBEM_GETITEM            CBEM_GETITEMW
  3155.     #else
  3156.     #define CBEM_INSERTITEM         CBEM_INSERTITEMA
  3157.     #define CBEM_SETITEM            CBEM_SETITEMA
  3158.     #define CBEM_GETITEM            CBEM_GETITEMA
  3159.     #endif
  3160.  
  3161.     #define CBES_EX_NOEDITIMAGE          0x00000001
  3162.     #define CBES_EX_NOEDITIMAGEINDENT    0x00000002
  3163.     #define CBES_EX_PATHWORDBREAKPROC    0x00000004
  3164.  
  3165.  
  3166.     typedef struct {
  3167.         NMHDR hdr;
  3168.         COMBOBOXEXITEM ceItem;
  3169.     } NMCOMBOBOXEX, *PNMCOMBOBOXEX;
  3170.  
  3171.  
  3172.     #define CBEN_GETDISPINFO        (CBEN_FIRST - 0)
  3173.     #define CBEN_INSERTITEM         (CBEN_FIRST - 1)
  3174.     #define CBEN_DELETEITEM         (CBEN_FIRST - 2)
  3175.     #define CBEN_BEGINEDIT          (CBEN_FIRST - 4)
  3176.     #define CBEN_ENDEDITA            (CBEN_FIRST - 5)
  3177.     #define CBEN_ENDEDITW            (CBEN_FIRST - 6)
  3178.             // lParam specifies why the endedit is happening
  3179.     #ifdef UNICODE
  3180.     #define CBEN_ENDEDIT CBEN_ENDEDITW
  3181.     #else
  3182.     #define CBEN_ENDEDIT CBEN_ENDEDITA
  3183.     #endif
  3184.     #define CBENF_KILLFOCUS         1
  3185.     #define CBENF_RETURN            2
  3186.     #define CBENF_ESCAPE            3
  3187.     #define CBENF_DROPDOWN          4
  3188.  
  3189.     #define CBEMAXSTRLEN 260
  3190.  
  3191.     // CBEN_ENDEDIT sends this information...
  3192.     // fChanged if the user actually did anything
  3193.     // iNewSelection gives what would be the new selection unless the notify is failed
  3194.     //                      iNewSelection may be CB_ERR if there's no match
  3195.     typedef struct {
  3196.             NMHDR hdr;
  3197.             BOOL fChanged;
  3198.             int iNewSelection;
  3199.             WCHAR szText[CBEMAXSTRLEN];
  3200.             int iWhy;
  3201.     } NMCBEENDEDITW, *PNMCBEENDEDITW;
  3202.  
  3203.     typedef struct {
  3204.             NMHDR hdr;
  3205.             BOOL fChanged;
  3206.             int iNewSelection;
  3207.             char szText[CBEMAXSTRLEN];
  3208.             int iWhy;
  3209.     } NMCBEENDEDITA, *PNMCBEENDEDITA;
  3210.  
  3211.     #ifdef UNICODE
  3212.     #define  NMCBEENDEDIT NMCBEENDEDITW
  3213.     #define  PNMCBEENDEDIT PNMCBEENDEDITW
  3214.     #else
  3215.     #define  NMCBEENDEDIT NMCBEENDEDITA
  3216.     #define  PNMCBEENDEDIT PNMCBEENDEDITA
  3217.     #endif
  3218.  
  3219.     #endif
  3220.  
  3221.  
  3222.  
  3223.     //====== TAB CONTROL ===========
  3224.  
  3225.     #define NOTABCONTROL
  3226.     #ifndef NOTABCONTROL
  3227.  
  3228.     #define TCS_SCROLLOPPOSITE      0x0001   // assumes multiline tab
  3229.     #define TCS_BOTTOM              0x0002
  3230.     #define TCS_RIGHT               0x0002
  3231.     #define TCS_MULTISELECT         0x0004  // allow multi-select in button mode
  3232.     #define TCS_FORCEICONLEFT       0x0010
  3233.     #define TCS_FORCELABELLEFT      0x0020
  3234.     #define TCS_HOTTRACK            0x0040
  3235.     #define TCS_VERTICAL            0x0080
  3236.     #define TCS_TABS                0x0000
  3237.     #define TCS_BUTTONS             0x0100
  3238.     #define TCS_SINGLELINE          0x0000
  3239.     #define TCS_MULTILINE           0x0200
  3240.     #define TCS_RIGHTJUSTIFY        0x0000
  3241.     #define TCS_FIXEDWIDTH          0x0400
  3242.     #define TCS_RAGGEDRIGHT         0x0800
  3243.     #define TCS_FOCUSONBUTTONDOWN   0x1000
  3244.     #define TCS_OWNERDRAWFIXED      0x2000
  3245.     #define TCS_TOOLTIPS            0x4000
  3246.     #define TCS_FOCUSNEVER          0x8000
  3247.  
  3248.     #define TCM_FIRST               0x1300
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.     #define TCM_GETIMAGELIST        (TCM_FIRST + 2)
  3255.     #define TabCtrl_GetImageList(hwnd) \
  3256.         (HIMAGELIST)SNDMSG((hwnd), TCM_GETIMAGELIST, 0, 0L)
  3257.  
  3258.  
  3259.     #define TCM_SETIMAGELIST        (TCM_FIRST + 3)
  3260.     #define TabCtrl_SetImageList(hwnd, himl) \
  3261.         (HIMAGELIST)SNDMSG((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl))
  3262.  
  3263.  
  3264.     #define TCM_GETITEMCOUNT        (TCM_FIRST + 4)
  3265.     #define TabCtrl_GetItemCount(hwnd) \
  3266.         (int)SNDMSG((hwnd), TCM_GETITEMCOUNT, 0, 0L)
  3267.  
  3268.  
  3269.  
  3270.     #define TCIF_TEXT               0x0001
  3271.     #define TCIF_IMAGE              0x0002
  3272.     #define TCIF_RTLREADING         0x0004
  3273.     #define TCIF_PARAM              0x0008
  3274.     #define TCIF_STATE              0x0010
  3275.  
  3276.  
  3277.     #define TCIS_BUTTONPRESSED      0x0001
  3278.  
  3279.     typedef struct tagTCITEMHEADERA
  3280.     {
  3281.         UINT mask;
  3282.         UINT lpReserved1;
  3283.         UINT lpReserved2;
  3284.         LPSTR pszText;
  3285.         int cchTextMax;
  3286.         int iImage;
  3287.     } TCITEMHEADERA, *LPTCITEMHEADERA;
  3288.  
  3289.     typedef struct tagTCITEMHEADERW
  3290.     {
  3291.         UINT mask;
  3292.         UINT lpReserved1;
  3293.         UINT lpReserved2;
  3294.         LPWSTR pszText;
  3295.         int cchTextMax;
  3296.         int iImage;
  3297.     } TCITEMHEADERW, *LPTCITEMHEADERW;
  3298.  
  3299.     #define TC_ITEMHEADERA         TCITEMHEADERA
  3300.     #define TC_ITEMHEADERW         TCITEMHEADERW
  3301.     #define TC_ITEMHEADER          TCITEMHEADER
  3302.  
  3303.     #ifdef UNICODE
  3304.     #define  TCITEMHEADER          TCITEMHEADERW
  3305.     #define  LPTCITEMHEADER        LPTCITEMHEADERW
  3306.     #else
  3307.     #define  TCITEMHEADER          TCITEMHEADERA
  3308.     #define  LPTCITEMHEADER        LPTCITEMHEADERA
  3309.     #endif
  3310.  
  3311.  
  3312.     typedef struct tagTCITEMA
  3313.     {
  3314.         UINT mask;
  3315.         DWORD dwState;
  3316.         DWORD dwStateMask;
  3317.         LPSTR pszText;
  3318.         int cchTextMax;
  3319.         int iImage;
  3320.  
  3321.         LPARAM lParam;
  3322.     } TCITEMA, *LPTCITEMA;
  3323.  
  3324.     typedef struct tagTCITEMW
  3325.     {
  3326.         UINT mask;
  3327.         DWORD dwState;
  3328.         DWORD dwStateMask;
  3329.         LPWSTR pszText;
  3330.         int cchTextMax;
  3331.         int iImage;
  3332.  
  3333.         LPARAM lParam;
  3334.     } TCITEMW, *LPTCITEMW;
  3335.  
  3336.     #define TC_ITEMA                TCITEMA
  3337.     #define TC_ITEMW                TCITEMW
  3338.     #define TC_ITEM                 TCITEM
  3339.  
  3340.     #ifdef UNICODE
  3341.     #define  TCITEM                 TCITEMW
  3342.     #define  LPTCITEM               LPTCITEMW
  3343.     #else
  3344.     #define  TCITEM                 TCITEMA
  3345.     #define  LPTCITEM               LPTCITEMA
  3346.     #endif
  3347.  
  3348.  
  3349.     #define TCM_GETITEMA            (TCM_FIRST + 5)
  3350.     #define TCM_GETITEMW            (TCM_FIRST + 60)
  3351.  
  3352.     #ifdef UNICODE
  3353.     #define TCM_GETITEM             TCM_GETITEMW
  3354.     #else
  3355.     #define TCM_GETITEM             TCM_GETITEMA
  3356.     #endif
  3357.  
  3358.     #define TabCtrl_GetItem(hwnd, iItem, pitem) \
  3359.         (BOOL)SNDMSG((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
  3360.  
  3361.  
  3362.     #define TCM_SETITEMA            (TCM_FIRST + 6)
  3363.     #define TCM_SETITEMW            (TCM_FIRST + 61)
  3364.  
  3365.     #ifdef UNICODE
  3366.     #define TCM_SETITEM             TCM_SETITEMW
  3367.     #else
  3368.     #define TCM_SETITEM             TCM_SETITEMA
  3369.     #endif
  3370.  
  3371.     #define TabCtrl_SetItem(hwnd, iItem, pitem) \
  3372.         (BOOL)SNDMSG((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem))
  3373.  
  3374.  
  3375.     #define TCM_INSERTITEMA         (TCM_FIRST + 7)
  3376.     #define TCM_INSERTITEMW         (TCM_FIRST + 62)
  3377.  
  3378.     #ifdef UNICODE
  3379.     #define TCM_INSERTITEM          TCM_INSERTITEMW
  3380.     #else
  3381.     #define TCM_INSERTITEM          TCM_INSERTITEMA
  3382.     #endif
  3383.  
  3384.     #define TabCtrl_InsertItem(hwnd, iItem, pitem)   \
  3385.         (int)SNDMSG((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM FAR*)(pitem))
  3386.  
  3387.  
  3388.     #define TCM_DELETEITEM          (TCM_FIRST + 8)
  3389.     #define TabCtrl_DeleteItem(hwnd, i) \
  3390.         (BOOL)SNDMSG((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L)
  3391.  
  3392.  
  3393.     #define TCM_DELETEALLITEMS      (TCM_FIRST + 9)
  3394.     #define TabCtrl_DeleteAllItems(hwnd) \
  3395.         (BOOL)SNDMSG((hwnd), TCM_DELETEALLITEMS, 0, 0L)
  3396.  
  3397.  
  3398.     #define TCM_GETITEMRECT         (TCM_FIRST + 10)
  3399.     #define TabCtrl_GetItemRect(hwnd, i, prc) \
  3400.         (BOOL)SNDMSG((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT FAR*)(prc))
  3401.  
  3402.  
  3403.     #define TCM_GETCURSEL           (TCM_FIRST + 11)
  3404.     #define TabCtrl_GetCurSel(hwnd) \
  3405.         (int)SNDMSG((hwnd), TCM_GETCURSEL, 0, 0)
  3406.  
  3407.  
  3408.     #define TCM_SETCURSEL           (TCM_FIRST + 12)
  3409.     #define TabCtrl_SetCurSel(hwnd, i) \
  3410.         (int)SNDMSG((hwnd), TCM_SETCURSEL, (WPARAM)i, 0)
  3411.  
  3412.  
  3413.     #define TCHT_NOWHERE            0x0001
  3414.     #define TCHT_ONITEMICON         0x0002
  3415.     #define TCHT_ONITEMLABEL        0x0004
  3416.     #define TCHT_ONITEM             (TCHT_ONITEMICON | TCHT_ONITEMLABEL)
  3417.  
  3418.  
  3419.     typedef struct tagTCHITTESTINFO
  3420.     {
  3421.         POINT pt;
  3422.         UINT flags;
  3423.     } TCHITTESTINFO, * LPTCHITTESTINFO;
  3424.     #define LPTC_HITTESTINFO        LPTCHITTESTINFO
  3425.     #define TC_HITTESTINFO          TCHITTESTINFO
  3426.  
  3427.  
  3428.     #define TCM_HITTEST             (TCM_FIRST + 13)
  3429.     #define TabCtrl_HitTest(hwndTC, pinfo) \
  3430.         (int)SNDMSG((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO FAR*)(pinfo))
  3431.  
  3432.  
  3433.     #define TCM_SETITEMEXTRA        (TCM_FIRST + 14)
  3434.     #define TabCtrl_SetItemExtra(hwndTC, cb) \
  3435.         (BOOL)SNDMSG((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L)
  3436.  
  3437.  
  3438.     #define TCM_ADJUSTRECT          (TCM_FIRST + 40)
  3439.     #define TabCtrl_AdjustRect(hwnd, bLarger, prc) \
  3440.         (int)SNDMSG(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)bLarger, (LPARAM)(RECT *)prc)
  3441.  
  3442.  
  3443.     #define TCM_SETITEMSIZE         (TCM_FIRST + 41)
  3444.     #define TabCtrl_SetItemSize(hwnd, x, y) \
  3445.         (DWORD)SNDMSG((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y))
  3446.  
  3447.  
  3448.     #define TCM_REMOVEIMAGE         (TCM_FIRST + 42)
  3449.     #define TabCtrl_RemoveImage(hwnd, i) \
  3450.             (void)SNDMSG((hwnd), TCM_REMOVEIMAGE, i, 0L)
  3451.  
  3452.  
  3453.     #define TCM_SETPADDING          (TCM_FIRST + 43)
  3454.     #define TabCtrl_SetPadding(hwnd,  cx, cy) \
  3455.             (void)SNDMSG((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy))
  3456.  
  3457.  
  3458.     #define TCM_GETROWCOUNT         (TCM_FIRST + 44)
  3459.     #define TabCtrl_GetRowCount(hwnd) \
  3460.             (int)SNDMSG((hwnd), TCM_GETROWCOUNT, 0, 0L)
  3461.  
  3462.  
  3463.     #define TCM_GETTOOLTIPS         (TCM_FIRST + 45)
  3464.     #define TabCtrl_GetToolTips(hwnd) \
  3465.             (HWND)SNDMSG((hwnd), TCM_GETTOOLTIPS, 0, 0L)
  3466.  
  3467.  
  3468.     #define TCM_SETTOOLTIPS         (TCM_FIRST + 46)
  3469.     #define TabCtrl_SetToolTips(hwnd, hwndTT) \
  3470.             (void)SNDMSG((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0L)
  3471.  
  3472.  
  3473.     #define TCM_GETCURFOCUS         (TCM_FIRST + 47)
  3474.     #define TabCtrl_GetCurFocus(hwnd) \
  3475.         (int)SNDMSG((hwnd), TCM_GETCURFOCUS, 0, 0)
  3476.  
  3477.     #define TCM_SETCURFOCUS         (TCM_FIRST + 48)
  3478.     #define TabCtrl_SetCurFocus(hwnd, i) \
  3479.         SNDMSG((hwnd),TCM_SETCURFOCUS, i, 0)
  3480.  
  3481.     #define TCM_SETMINTABWIDTH      (TCM_FIRST + 49)
  3482.     #define TabCtrl_SetMinTabWidth(hwnd, x) \
  3483.             (int)SNDMSG((hwnd), TCM_SETMINTABWIDTH, 0, x)
  3484.  
  3485.  
  3486.     #define TCM_DESELECTALL         (TCM_FIRST + 50)
  3487.     #define TabCtrl_DeselectAll(hwnd, fExcludeFocus)\
  3488.             (void)SNDMSG((hwnd), TCM_DESELECTALL, fExcludeFocus, 0)
  3489.  
  3490.     #define TCN_KEYDOWN             (TCN_FIRST - 0)
  3491.     typedef struct tagTCKEYDOWN
  3492.     {
  3493.         NMHDR hdr;
  3494.         WORD wVKey;
  3495.         UINT flags;
  3496.     } NMTCKEYDOWN;
  3497.     #define TC_KEYDOWN              NMTCKEYDOWN
  3498.  
  3499.     #define TCN_SELCHANGE           (TCN_FIRST - 1)
  3500.     #define TCN_SELCHANGING         (TCN_FIRST - 2)
  3501.  
  3502.     #endif
  3503.  
  3504.  
  3505.     //====== ANIMATE CONTROL =======
  3506.  
  3507.     const LPSTR ANIMATE_CLASS       = "SysAnimate32";
  3508.  
  3509.     const UINT ACS_CENTER           = 0x0001;
  3510.     const UINT ACS_TRANSPARENT      = 0x0002;
  3511.     const UINT ACS_AUTOPLAY         = 0x0004;
  3512.  
  3513.  
  3514.     const UINT ACM_OPENA            = WM_USER + 100;
  3515.     const UINT ACM_OPEN             = WM_USER + 100;
  3516.  
  3517.     const UINT ACM_PLAY             = WM_USER + 101;
  3518.     const UINT ACM_STOP             = WM_USER + 102;
  3519.  
  3520.  
  3521.     const UINT ACN_START            = 1;
  3522.     const UINT ACN_STOP             = 2;
  3523.  
  3524.  
  3525.     /*
  3526.     #define Animate_Create(hwndP, id, dwStyle, hInstance)  \
  3527.              CreateWindow(ANIMATE_CLASS, NULL,          \
  3528.                           dwStyle, 0, 0, 0, 0, hwndP, (HMENU)(id), \
  3529.                           hInstance, NULL)
  3530.  
  3531.     #define Animate_Open(hwnd, szName)
  3532.              (BOOL)SendMessage(hwnd, ACM_OPEN, 0, \
  3533.              (LPARAM)(LPTSTR)(szName))
  3534.  
  3535.     #define Animate_Play(hwnd, from, to, rep) \
  3536.              (BOOL)SendMessage(hwnd, ACM_PLAY, (WPARAM)(UINT)(rep), \
  3537.              (LPARAM)MAKELONG(from, to))
  3538.  
  3539.     #define Animate_Stop(hwnd) \
  3540.              (BOOL)SendMessage(hwnd, ACM_STOP, 0, 0)
  3541.  
  3542.     #define Animate_Close(hwnd) \
  3543.              Animate_Open(hwnd, NULL)
  3544.  
  3545.     #define Animate_Seek(hwnd, frame) \
  3546.              Animate_Play(hwnd, frame, frame, 1)
  3547.  
  3548.     */
  3549.  
  3550.     //====== MONTHCAL CONTROL ==========
  3551.  
  3552.     #define NOMONTHCAL
  3553.     #ifndef NOMONTHCAL
  3554.  
  3555.     // bit-packed array of "bold" info for a month
  3556.     // if a bit is on, that day is drawn bold
  3557.     typedef DWORD MONTHDAYSTATE, * LPMONTHDAYSTATE;
  3558.  
  3559.  
  3560.     #define MCM_FIRST           0x1000
  3561.  
  3562.     // BOOL MonthCal_GetCurSel(HWND hmc, LPSYSTEMTIME pst)
  3563.     //   returns FALSE if MCS_MULTISELECT
  3564.     //   returns TRUE and sets *pst to the currently selected date otherwise
  3565.     #define MCM_GETCURSEL       (MCM_FIRST + 1)
  3566.     #define MonthCal_GetCurSel(hmc, pst)    (BOOL)SNDMSG(hmc, MCM_GETCURSEL, 0, (LPARAM)(pst))
  3567.  
  3568.     // BOOL MonthCal_SetCurSel(HWND hmc, LPSYSTEMTIME pst)
  3569.     //   returns FALSE if MCS_MULTISELECT
  3570.     //   returns TURE and sets the currently selected date to *pst otherwise
  3571.     #define MCM_SETCURSEL       (MCM_FIRST + 2)
  3572.     #define MonthCal_SetCurSel(hmc, pst)    (BOOL)SNDMSG(hmc, MCM_SETCURSEL, 0, (LPARAM)(pst))
  3573.  
  3574.     // DWORD MonthCal_GetMaxSelCount(HWND hmc)
  3575.     //   returns the maximum number of selectable days allowed
  3576.     #define MCM_GETMAXSELCOUNT  (MCM_FIRST + 3)
  3577.     #define MonthCal_GetMaxSelCount(hmc)    (DWORD)SNDMSG(hmc, MCM_GETMAXSELCOUNT, 0, 0L)
  3578.  
  3579.     // BOOL MonthCal_SetMaxSelCount(HWND hmc, UINT n)
  3580.     //   sets the max number days that can be selected iff MCS_MULTISELECT
  3581.     #define MCM_SETMAXSELCOUNT  (MCM_FIRST + 4)
  3582.     #define MonthCal_SetMaxSelCount(hmc, n) (BOOL)SNDMSG(hmc, MCM_SETMAXSELCOUNT, (WPARAM)(n), 0L)
  3583.  
  3584.     // BOOL MonthCal_GetSelRange(HWND hmc, LPSYSTEMTIME rgst)
  3585.     //   sets rgst[0] to the first day of the selection range
  3586.     //   sets rgst[1] to the last day of the selection range
  3587.     #define MCM_GETSELRANGE     (MCM_FIRST + 5)
  3588.     #define MonthCal_GetSelRange(hmc, rgst) SNDMSG(hmc, MCM_GETSELRANGE, 0, (LPARAM)(rgst))
  3589.  
  3590.     // BOOL MonthCal_SetSelRange(HWND hmc, LPSYSTEMTIME rgst)
  3591.     //   selects the range of days from rgst[0] to rgst[1]
  3592.     #define MCM_SETSELRANGE     (MCM_FIRST + 6)
  3593.     #define MonthCal_SetSelRange(hmc, rgst) SNDMSG(hmc, MCM_SETSELRANGE, 0, (LPARAM)(rgst))
  3594.  
  3595.     // DWORD MonthCal_GetMonthRange(HWND hmc, DWORD gmr, LPSYSTEMTIME rgst)
  3596.     //   if rgst specified, sets rgst[0] to the starting date and
  3597.     //      and rgst[1] to the ending date of the the selectable (non-grayed)
  3598.     //      days if GMR_VISIBLE or all the displayed days (including grayed)
  3599.     //      if GMR_DAYSTATE.
  3600.     //   returns the number of months spanned by the above range.
  3601.     #define MCM_GETMONTHRANGE   (MCM_FIRST + 7)
  3602.     #define MonthCal_GetMonthRange(hmc, gmr, rgst)  (DWORD)SNDMSG(hmc, MCM_GETMONTHRANGE, (WPARAM)(gmr), (LPARAM)(rgst))
  3603.  
  3604.     // BOOL MonthCal_SetDayState(HWND hmc, int cbds, DAYSTATE *rgds)
  3605.     //   cbds is the count of DAYSTATE items in rgds and it must be equal
  3606.     //   to the value returned from MonthCal_GetMonthRange(hmc, GMR_DAYSTATE, NULL)
  3607.     //   This sets the DAYSTATE bits for each month (grayed and non-grayed
  3608.     //   days) displayed in the calendar. The first bit in a month's DAYSTATE
  3609.     //   corresponts to bolding day 1, the second bit affects day 2, etc.
  3610.     #define MCM_SETDAYSTATE     (MCM_FIRST + 8)
  3611.     #define MonthCal_SetDayState(hmc, cbds, rgds)   SNDMSG(hmc, MCM_SETDAYSTATE, (WPARAM)(cbds), (LPARAM)(rgds))
  3612.  
  3613.     // BOOL MonthCal_GetMinReqRect(HWND hmc, LPRECT prc)
  3614.     //   sets *prc the minimal size needed to display one month
  3615.     #define MCM_GETMINREQRECT   (MCM_FIRST + 9)
  3616.     #define MonthCal_GetMinReqRect(hmc, prc)        SNDMSG(hmc, MCM_GETMINREQRECT, 0, (LPARAM)(prc))
  3617.  
  3618.     // set what day is "today"   send NULL to revert back to real date
  3619.     #define MCM_SETTODAY    (MCM_FIRST + 12)
  3620.     #define MonthCal_SetToday(hmc, pst)             SNDMSG(hmc, MCM_SETTODAY, 0, (LPARAM)pst)
  3621.  
  3622.     // get what day is "today"
  3623.     // returns BOOL for success/failure
  3624.     #define MCM_GETTODAY    (MCM_FIRST + 13)
  3625.     #define MonthCal_GetToday(hmc, pst)             (BOOL)SNDMSG(hmc, MCM_GETTODAY, 0, (LPARAM)pst)
  3626.  
  3627.     // determine what pinfo->pt is over
  3628.     #define MCM_HITTEST          (MCM_FIRST + 14)
  3629.     #define MonthCal_HitTest(hmc, pinfo) \
  3630.             SNDMSG(hmc, MCM_HITTEST, 0, (LPARAM)(PMCHITTESTINFO)pinfo)
  3631.  
  3632.     typedef struct {
  3633.             UINT cbSize;
  3634.             POINT pt;
  3635.  
  3636.             UINT uHit;   // out param
  3637.             SYSTEMTIME st;
  3638.     } MCHITTESTINFO, *PMCHITTESTINFO;
  3639.  
  3640.     #define MCHT_TITLE                      0x00010000
  3641.     #define MCHT_CALENDAR                   0x00020000
  3642.     #define MCHT_TODAYLINK                  0x00030000
  3643.  
  3644.     #define MCHT_NEXT                       0x01000000   // these indicate that hitting
  3645.     #define MCHT_PREV                       0x02000000  // here will go to the next/prev month
  3646.  
  3647.     #define MCHT_NOWHERE                    0x00000000
  3648.  
  3649.     #define MCHT_TITLEBK                    (MCHT_TITLE)
  3650.     #define MCHT_TITLEMONTH                 (MCHT_TITLE | 0x0001)
  3651.     #define MCHT_TITLEYEAR                  (MCHT_TITLE | 0x0002)
  3652.     #define MCHT_TITLEBTNNEXT               (MCHT_TITLE | MCHT_NEXT | 0x0003)
  3653.     #define MCHT_TITLEBTNPREV               (MCHT_TITLE | MCHT_PREV | 0x0003)
  3654.  
  3655.     #define MCHT_CALENDARBK                 (MCHT_CALENDAR)
  3656.     #define MCHT_CALENDARDATE               (MCHT_CALENDAR | 0x0001)
  3657.     #define MCHT_CALENDARDATENEXT           (MCHT_CALENDARDATE | MCHT_NEXT)
  3658.     #define MCHT_CALENDARDATEPREV           (MCHT_CALENDARDATE | MCHT_PREV)
  3659.     #define MCHT_CALENDARDAY                (MCHT_CALENDAR | 0x0002)
  3660.     #define MCHT_CALENDARWEEKNUM            (MCHT_CALENDAR | 0x0003)
  3661.  
  3662.     // set colors to draw control with -- see MCSC_ bits below
  3663.     #define MCM_SETCOLOR            (MCM_FIRST + 10)
  3664.     #define MonthCal_SetColor(hmc, iColor, clr) SNDMSG(hmc, MCM_SETCOLOR, iColor, clr)
  3665.  
  3666.     #define MCM_GETCOLOR            (MCM_FIRST + 11)
  3667.     #define MonthCal_GetColor(hmc, iColor) SNDMSG(hmc, MCM_SETCOLOR, iColor, 0)
  3668.  
  3669.     #define MCSC_BACKGROUND   0   // the background color (between months)
  3670.     #define MCSC_TEXT         1   // the dates
  3671.     #define MCSC_TITLEBK      2   // background of the title
  3672.     #define MCSC_TITLETEXT    3
  3673.     #define MCSC_MONTHBK      4   // background within the month cal
  3674.     #define MCSC_TRAILINGTEXT 5   // the text color of header & trailing days
  3675.  
  3676.     // set first day of week to iDay:
  3677.     // 0 for Monday, 1 for Tuesday, ..., 6 for Sunday
  3678.     // -1 for means use locale info
  3679.     #define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST + 15)
  3680.     #define MonthCal_SetFirstDayOfWeek(hmc, iDay) \
  3681.             SNDMSG(hmc, MCM_SETFIRSTDAYOFWEEK, 0, iDay)
  3682.  
  3683.     // DWORD result...  low word has the day.  high word is bool if this is app set
  3684.     // or not (FALSE == using locale info)
  3685.     #define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST + 16)
  3686.     #define MonthCal_GetFirstDayOfWeek(hmc) \
  3687.             (DWORD)SNDMSG(hmc, MCM_GETFIRSTDAYOFWEEK, 0, 0)
  3688.  
  3689.     // DWORD MonthCal_GetRange(HWND hmc, LPSYSTEMTIME rgst)
  3690.     //   modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
  3691.     //   modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
  3692.     //   returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
  3693.     #define MCM_GETRANGE (MCM_FIRST + 17)
  3694.     #define MonthCal_GetRange(hmc, rgst) \
  3695.             (DWORD)SNDMSG(hmc, MCM_GETRANGE, 0, (LPARAM)(rgst))
  3696.  
  3697.     // BOOL MonthCal_SetRange(HWND hmc, DWORD gdtr, LPSYSTEMTIME rgst)
  3698.     //   if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
  3699.     //   if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
  3700.     //   returns TRUE on success, FALSE on error (such as invalid parameters)
  3701.     #define MCM_SETRANGE (MCM_FIRST + 18)
  3702.     #define MonthCal_SetRange(hmc, gd, rgst) \
  3703.             (BOOL)SNDMSG(hmc, MCM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
  3704.  
  3705.     // int MonthCal_GetMonthDelta(HWND hmc)
  3706.     //   returns the number of months one click on a next/prev button moves by
  3707.     #define MCM_GETMONTHDELTA (MCM_FIRST + 19)
  3708.     #define MonthCal_GetMonthDelta(hmc) \
  3709.             (int)SNDMSG(hmc, MCM_GETMONTHDELTA, 0, 0)
  3710.  
  3711.     // int MonthCal_SetMonthDelta(HWND hmc, int n)
  3712.     //   sets the month delta to n. n==0 reverts to moving by a page of months
  3713.     //   returns the previous value of n.
  3714.     #define MCM_SETMONTHDELTA (MCM_FIRST + 20)
  3715.     #define MonthCal_SetMonthDelta(hmc, n) \
  3716.             (int)SNDMSG(hmc, MCM_SETMONTHDELTA, n, 0)
  3717.  
  3718.  
  3719.     // MCN_SELCHANGE is sent whenever the currently displayed date changes
  3720.     // via month change, year change, keyboard navigation, prev/next button
  3721.     //
  3722.     typedef struct tagNMSELCHANGE
  3723.     {
  3724.         NMHDR           nmhdr;  // this must be first, so we don't break WM_NOTIFY
  3725.  
  3726.         SYSTEMTIME      stSelStart;
  3727.         SYSTEMTIME      stSelEnd;
  3728.     } NMSELCHANGE, * LPNMSELCHANGE;
  3729.  
  3730.     #define MCN_SELCHANGE       (MCN_FIRST + 1)
  3731.  
  3732.     // MCN_GETDAYSTATE is sent for MCS_DAYSTATE controls whenever new daystate
  3733.     // information is needed (month or year scroll) to draw bolding information.
  3734.     // The app must fill in cDayState months worth of information starting from
  3735.     // stStart date. The app may fill in the array at prgDayState or change
  3736.     // prgDayState to point to a different array out of which the information
  3737.     // will be copied. (similar to tooltips)
  3738.     //
  3739.     typedef struct tagNMDAYSTATE
  3740.     {
  3741.         NMHDR           nmhdr;  // this must be first, so we don't break WM_NOTIFY
  3742.  
  3743.         SYSTEMTIME      stStart;
  3744.         int             cDayState;
  3745.  
  3746.         LPMONTHDAYSTATE prgDayState; // points to cDayState MONTHDAYSTATEs
  3747.     } NMDAYSTATE, * LPNMDAYSTATE;
  3748.  
  3749.     #define MCN_GETDAYSTATE     (MCN_FIRST + 3)
  3750.  
  3751.     // MCN_SELECT is sent whenever a selection has occured (via mouse or keyboard)
  3752.     //
  3753.     typedef NMSELCHANGE NMSELECT, * LPNMSELECT;
  3754.  
  3755.  
  3756.     #define MCN_SELECT          (MCN_FIRST + 4)
  3757.  
  3758.  
  3759.     #define MCS_DAYSTATE        0x0001
  3760.     #define MCS_MULTISELECT     0x0002
  3761.     #define MCS_WEEKNUMBERS     0x0004
  3762.     #define MCS_NOTODAY         0x0008
  3763.  
  3764.  
  3765.     #define GMR_VISIBLE     0       // visible portion of display
  3766.     #define GMR_DAYSTATE    1       // above plus the grayed out parts of
  3767.                                     // partially displayed months
  3768.  
  3769.  
  3770.     #endif // NOMONTHCAL
  3771.  
  3772.  
  3773.     //====== DATETIMEPICK CONTROL ==========
  3774.  
  3775.     #define NODATETIMEPICK
  3776.     #ifndef NODATETIMEPICK
  3777.  
  3778.     #define DTM_FIRST        0x1000
  3779.  
  3780.     // DWORD DateTimePick_GetSystemtime(HWND hdp, LPSYSTEMTIME pst)
  3781.     //   returns GDT_NONE if "none" is selected (DTS_SHOWNONE only)
  3782.     //   returns GDT_VALID and modifies *pst to be the currently selected value
  3783.     #define DTM_GETSYSTEMTIME   (DTM_FIRST + 1)
  3784.     #define DateTime_GetSystemtime(hdp, pst)    (DWORD)SNDMSG(hdp, DTM_GETSYSTEMTIME, 0, (LPARAM)(pst))
  3785.  
  3786.     // BOOL DateTime_SetSystemtime(HWND hdp, DWORD gd, LPSYSTEMTIME pst)
  3787.     //   if gd==GDT_NONE, sets datetimepick to None (DTS_SHOWNONE only)
  3788.     //   if gd==GDT_VALID, sets datetimepick to *pst
  3789.     //   returns TRUE on success, FALSE on error (such as bad params)
  3790.     #define DTM_SETSYSTEMTIME   (DTM_FIRST + 2)
  3791.     #define DateTime_SetSystemtime(hdp, gd, pst)    (BOOL)SNDMSG(hdp, DTM_SETSYSTEMTIME, (LPARAM)(gd), (LPARAM)(pst))
  3792.  
  3793.     // DWORD DateTime_GetRange(HWND hdp, LPSYSTEMTIME rgst)
  3794.     //   modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
  3795.     //   modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
  3796.     //   returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
  3797.     #define DTM_GETRANGE (DTM_FIRST + 3)
  3798.     #define DateTime_GetRange(hdp, rgst)  (DWORD)SNDMSG(hdp, DTM_GETRANGE, 0, (LPARAM)(rgst))
  3799.  
  3800.     // BOOL DateTime_SetRange(HWND hdp, DWORD gdtr, LPSYSTEMTIME rgst)
  3801.     //   if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
  3802.     //   if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
  3803.     //   returns TRUE on success, FALSE on error (such as invalid parameters)
  3804.     #define DTM_SETRANGE (DTM_FIRST + 4)
  3805.     #define DateTime_SetRange(hdp, gd, rgst)  (BOOL)SNDMSG(hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst))
  3806.  
  3807.     // BOOL DateTime_SetFormat(HWND hdp, LPCTSTR sz)
  3808.     //   sets the display formatting string to sz (see GetDateFormat and GetTimeFormat for valid formatting chars)
  3809.     //   NOTE: 'X' is a valid formatting character which indicates that the application
  3810.     //   will determine how to display information. Such apps must support DTN_WMKEYDOWN,
  3811.     //   DTN_FORMAT, and DTN_FORMATQUERY.
  3812.     #define DTM_SETFORMATA (DTM_FIRST + 5)
  3813.     #define DTM_SETFORMATW (DTM_FIRST + 50)
  3814.  
  3815.     #ifdef UNICODE
  3816.     #define DTM_SETFORMAT       DTM_SETFORMATW
  3817.     #else
  3818.     #define DTM_SETFORMAT       DTM_SETFORMATA
  3819.     #endif
  3820.  
  3821.     #define DateTime_SetFormat(hdp, sz)  (BOOL)SNDMSG(hdp, DTM_SETFORMAT, 0, (LPARAM)(sz))
  3822.  
  3823.  
  3824.     #define DTM_SETMCCOLOR    (DTM_FIRST + 6)
  3825.     #define DateTime_SetMonthCalColor(hdp, iColor, clr) SNDMSG(hdp, DTM_SETMCCOLOR, iColor, clr)
  3826.  
  3827.     #define DTM_GETMCCOLOR    (DTM_FIRST + 7)
  3828.     #define DateTime_GetMonthCalColor(hdp, iColor) SNDMSG(hdp, DTM_GETMCCOLOR, iColor, 0)
  3829.  
  3830.     // HWND DateTime_GetMonthCal(HWND hdp)
  3831.     //   returns the HWND of the MonthCal popup window. Only valid
  3832.     // between DTN_DROPDOWN and DTN_CLOSEUP notifications.
  3833.     #define DTM_GETMONTHCAL   (DTM_FIRST + 8)
  3834.     #define DateTime_GetMonthCal(hdp) (HWND)SNDMSG(hdp, DTM_GETMONTHCAL, 0, 0)
  3835.  
  3836.     #define DTM_SETMCFONT     (DTM_FIRST + 9)
  3837.     #define DateTime_SetMonthCalFont(hdp, hfont, fRedraw) SNDMSG(hdp, DTM_SETMCFONT, (WPARAM)hfont, (LPARAM)fRedraw)
  3838.  
  3839.     #define DTM_GETMCFONT     (DTM_FIRST + 10)
  3840.     #define DateTime_GetMonthCalFont(hdp) SNDMSG(hdp, DTM_GETMCFONT, 0, 0)
  3841.  
  3842.     #define DTS_UPDOWN          0x0001 // use UPDOWN instead of MONTHCAL
  3843.     #define DTS_SHOWNONE        0x0002 // allow a NONE selection
  3844.     #define DTS_SHORTDATEFORMAT 0x0000 // use the short date format (app must forward WM_WININICHANGE messages)
  3845.     #define DTS_LONGDATEFORMAT  0x0004 // use the long date format (app must forward WM_WININICHANGE messages)
  3846.     #define DTS_TIMEFORMAT      0x0009 // use the time format (app must forward WM_WININICHANGE messages)
  3847.     #define DTS_APPCANPARSE     0x0010 // allow user entered strings (app MUST respond to DTN_USERSTRING)
  3848.     #define DTS_RIGHTALIGN      0x0020 // right-align popup instead of left-align it
  3849.  
  3850.     #define DTN_DATETIMECHANGE  (DTN_FIRST + 1) // the systemtime has changed
  3851.     typedef struct tagNMDATETIMECHANGE
  3852.     {
  3853.         NMHDR       nmhdr;
  3854.         DWORD       dwFlags;    // GDT_VALID or GDT_NONE
  3855.         SYSTEMTIME  st;         // valid iff dwFlags==GDT_VALID
  3856.     } NMDATETIMECHANGE, * LPNMDATETIMECHANGE;
  3857.  
  3858.     #define DTN_USERSTRINGA  (DTN_FIRST + 2) // the user has entered a string
  3859.     #define DTN_USERSTRINGW  (DTN_FIRST + 15)
  3860.     typedef struct tagNMDATETIMESTRINGA
  3861.     {
  3862.         NMHDR      nmhdr;
  3863.         LPCSTR     pszUserString;  // string user entered
  3864.         SYSTEMTIME st;             // app fills this in
  3865.         DWORD      dwFlags;        // GDT_VALID or GDT_NONE
  3866.     } NMDATETIMESTRINGA, * LPNMDATETIMESTRINGA;
  3867.  
  3868.     typedef struct tagNMDATETIMESTRINGW
  3869.     {
  3870.         NMHDR      nmhdr;
  3871.         LPCWSTR    pszUserString;  // string user entered
  3872.         SYSTEMTIME st;             // app fills this in
  3873.         DWORD      dwFlags;        // GDT_VALID or GDT_NONE
  3874.     } NMDATETIMESTRINGW, * LPNMDATETIMESTRINGW;
  3875.  
  3876.     #ifdef UNICODE
  3877.     #define DTN_USERSTRING          DTN_USERSTRINGW
  3878.     #define NMDATETIMESTRING        NMDATETIMESTRINGW
  3879.     #define LPNMDATETIMESTRING      LPNMDATETIMESTRINGW
  3880.     #else
  3881.     #define DTN_USERSTRING          DTN_USERSTRINGA
  3882.     #define NMDATETIMESTRING        NMDATETIMESTRINGA
  3883.     #define LPNMDATETIMESTRING      LPNMDATETIMESTRINGA
  3884.     #endif
  3885.  
  3886.  
  3887.     #define DTN_WMKEYDOWNA  (DTN_FIRST + 3) // modify keydown on app format field (X)
  3888.     #define DTN_WMKEYDOWNW  (DTN_FIRST + 16)
  3889.     typedef struct tagNMDATETIMEWMKEYDOWNA
  3890.     {
  3891.         NMHDR      nmhdr;
  3892.         int        nVirtKey;  // virtual key code of WM_KEYDOWN which MODIFIES an X field
  3893.         LPCSTR     pszFormat; // format substring
  3894.         SYSTEMTIME st;        // current systemtime, app should modify based on key
  3895.     } NMDATETIMEWMKEYDOWNA, * LPNMDATETIMEWMKEYDOWNA;
  3896.  
  3897.     typedef struct tagNMDATETIMEWMKEYDOWNW
  3898.     {
  3899.         NMHDR      nmhdr;
  3900.         int        nVirtKey;  // virtual key code of WM_KEYDOWN which MODIFIES an X field
  3901.         LPCWSTR    pszFormat; // format substring
  3902.         SYSTEMTIME st;        // current systemtime, app should modify based on key
  3903.     } NMDATETIMEWMKEYDOWNW, * LPNMDATETIMEWMKEYDOWNW;
  3904.  
  3905.     #ifdef UNICODE
  3906.     #define DTN_WMKEYDOWN           DTN_WMKEYDOWNW
  3907.     #define NMDATETIMEWMKEYDOWN     NMDATETIMEWMKEYDOWNW
  3908.     #define LPNMDATETIMEWMKEYDOWN   LPNMDATETIMEWMKEYDOWNW
  3909.     #else
  3910.     #define DTN_WMKEYDOWN           DTN_WMKEYDOWNA
  3911.     #define NMDATETIMEWMKEYDOWN     NMDATETIMEWMKEYDOWNA
  3912.     #define LPNMDATETIMEWMKEYDOWN   LPNMDATETIMEWMKEYDOWNA
  3913.     #endif
  3914.  
  3915.  
  3916.     #define DTN_FORMATA  (DTN_FIRST + 4) // query display for app format field (X)
  3917.     #define DTN_FORMATW  (DTN_FIRST + 17)
  3918.     typedef struct tagNMDATETIMEFORMATA
  3919.     {
  3920.         NMHDR nmhdr;
  3921.         LPCSTR  pszFormat;   // format substring
  3922.         SYSTEMTIME st;       // current systemtime
  3923.         LPCSTR pszDisplay;   // string to display
  3924.         CHAR szDisplay[64];  // buffer pszDisplay originally points at
  3925.     } NMDATETIMEFORMATA, * LPNMDATETIMEFORMATA;
  3926.  
  3927.     typedef struct tagNMDATETIMEFORMATW
  3928.     {
  3929.         NMHDR nmhdr;
  3930.         LPCWSTR pszFormat;   // format substring
  3931.         SYSTEMTIME st;       // current systemtime
  3932.         LPCWSTR pszDisplay;  // string to display
  3933.         WCHAR szDisplay[64]; // buffer pszDisplay originally points at
  3934.     } NMDATETIMEFORMATW, * LPNMDATETIMEFORMATW;
  3935.  
  3936.     #ifdef UNICODE
  3937.     #define DTN_FORMAT             DTN_FORMATW
  3938.     #define NMDATETIMEFORMAT        NMDATETIMEFORMATW
  3939.     #define LPNMDATETIMEFORMAT      LPNMDATETIMEFORMATW
  3940.     #else
  3941.     #define DTN_FORMAT             DTN_FORMATA
  3942.     #define NMDATETIMEFORMAT        NMDATETIMEFORMATA
  3943.     #define LPNMDATETIMEFORMAT      LPNMDATETIMEFORMATA
  3944.     #endif
  3945.  
  3946.  
  3947.     #define DTN_FORMATQUERYA  (DTN_FIRST + 5) // query formatting info for app format field (X)
  3948.     #define DTN_FORMATQUERYW (DTN_FIRST + 18)
  3949.     typedef struct tagNMDATETIMEFORMATQUERYA
  3950.     {
  3951.         NMHDR nmhdr;
  3952.         LPCSTR pszFormat;  // format substring
  3953.         SIZE szMax;        // max bounding rectangle app will use for this format string
  3954.     } NMDATETIMEFORMATQUERYA, * LPNMDATETIMEFORMATQUERYA;
  3955.  
  3956.     typedef struct tagNMDATETIMEFORMATQUERYW
  3957.     {
  3958.         NMHDR nmhdr;
  3959.         LPCWSTR pszFormat; // format substring
  3960.         SIZE szMax;        // max bounding rectangle app will use for this format string
  3961.     } NMDATETIMEFORMATQUERYW, * LPNMDATETIMEFORMATQUERYW;
  3962.  
  3963.     #ifdef UNICODE
  3964.     #define DTN_FORMATQUERY         DTN_FORMATQUERYW
  3965.     #define NMDATETIMEFORMATQUERY   NMDATETIMEFORMATQUERYW
  3966.     #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYW
  3967.     #else
  3968.     #define DTN_FORMATQUERY         DTN_FORMATQUERYA
  3969.     #define NMDATETIMEFORMATQUERY   NMDATETIMEFORMATQUERYA
  3970.     #define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYA
  3971.     #endif
  3972.  
  3973.  
  3974.     #define DTN_DROPDOWN    (DTN_FIRST + 6) // MonthCal has dropped down
  3975.     #define DTN_CLOSEUP     (DTN_FIRST + 7) // MonthCal is popping up
  3976.  
  3977.  
  3978.     #define GDTR_MIN     0x0001
  3979.     #define GDTR_MAX     0x0002
  3980.  
  3981.     #define GDT_ERROR    -1
  3982.     #define GDT_VALID    0
  3983.     #define GDT_NONE     1
  3984.  
  3985.     #endif // NODATETIMEPICK
  3986.  
  3987.  
  3988.  
  3989.  
  3990.     //====== TrackMouseEvent  ======
  3991.  
  3992.     #define NOTRACKMOUSEEVENT
  3993.     #ifndef NOTRACKMOUSEEVENT
  3994.  
  3995.     //
  3996.     // If the messages for TrackMouseEvent have not been defined then define them
  3997.     // now.
  3998.     //
  3999.     #ifndef WM_MOUSEHOVER
  4000.     #define WM_MOUSEHOVER                   0x02A1
  4001.     #define WM_MOUSELEAVE                   0x02A3
  4002.     #endif
  4003.  
  4004.     //
  4005.     // If the TRACKMOUSEEVENT structure and associated flags havent been declared
  4006.     // then declare them now.
  4007.     //
  4008.     #ifndef TME_HOVER
  4009.  
  4010.     #define TME_HOVER       0x00000001
  4011.     #define TME_LEAVE       0x00000002
  4012.     #define TME_QUERY       0x40000000
  4013.     #define TME_CANCEL      0x80000000
  4014.  
  4015.  
  4016.     #define HOVER_DEFAULT   0xFFFFFFFF
  4017.  
  4018.     typedef struct tagTRACKMOUSEEVENT {
  4019.         DWORD cbSize;
  4020.         DWORD dwFlags;
  4021.         HWND  hwndTrack;
  4022.         DWORD dwHoverTime;
  4023.     } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
  4024.  
  4025.     #endif // !TME_HOVER
  4026.  
  4027.     //
  4028.     // Declare _TrackMouseEvent.  This API tries to use the window manager's
  4029.     // implementation of TrackMouseEvent if it is present, otherwise it emulates.
  4030.     //
  4031.     WINCOMMCTRLAPI
  4032.     BOOL
  4033.     WINAPI
  4034.     _TrackMouseEvent(
  4035.         LPTRACKMOUSEEVENT lpEventTrack);
  4036.  
  4037.     #endif // !NOTRACKMOUSEEVENT
  4038.  
  4039. }
  4040.